Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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.