Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Please i need some help.
I have to output a CSV file in UTF-8-BOM for my client, because in UTF-8 several special caracters are not encoding as well...
In this topic, I found a routine which can encode CSV file, but not in UTF-8-BOM...
Please, somebody has a solution to this problem ?
PS: not by passing with the custom component tWriteHeaderLineToFileWithBOM
I don't know why title of my CSV column disapear...
So i changed your tJava code for this code and it's work :
String filename = "test.csv"; 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("OptionValue,OptionName\n"); } catch (IOException e) { e.printStackTrace(); }
Thanks you again @rhall
Oh I see. You raised a question about file name and row count previously didn't you? All you need to do to enable that is to put the tJava before the subjob that writes the header values. But you seem to have sorted this 🙂