Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem to generate csv file with section ('§') character

Hi, my job is meant to generate CSV files with headers containing the section/paragraph character. When I run my job directly from the Talend studio it works but when I generate a build and then launch the batch file, section characters in generated CSV files appears in hexa like "xA7".

 

Here is the code of my tJava that generate the files:


String filename = "myFile";
String content="";
byte[] bytes = content.getBytes();

try (PrintStream w = new PrintStream(new FileOutputStream(filename))) {
w.write('\ufeef'); // emits 0xef
w.write('\ufebb'); // emits 0xbb
w.write('\ufebf'); // emits 0xbf
w.print('\u00A7'+"OF_Num_OF;§OF_Status\r\n");
w.print(row1.CODE+";Released");
} catch (IOException e) {
e.printStackTrace();
}

 

Thank you for your help

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I finally succeeded to solve my problem. For anyone interested, in Talend studio you have to go to: "File -> edit project properties -> build -> shell -> bat" and then you have to add this line "-Dfile.encoding=utf-8" after "java" like shown in the attached file. This option will start the CMD with UTF-8 encoding.

 

 


2020-06-18 12_53_24-Paramètres du projet.png

View solution in original post

1 Reply
Anonymous
Not applicable
Author

I finally succeeded to solve my problem. For anyone interested, in Talend studio you have to go to: "File -> edit project properties -> build -> shell -> bat" and then you have to add this line "-Dfile.encoding=utf-8" after "java" like shown in the attached file. This option will start the CMD with UTF-8 encoding.

 

 


2020-06-18 12_53_24-Paramètres du projet.png