<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert a CSV UTF-8 to UTF-8-BOM in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333251#M102054</link>
    <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp; thanks you for your answer !&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I don't understand how i can write the file path in the tJava before my file is created ?&lt;/P&gt; 
&lt;PRE&gt;String filename = "/Users/richardhall/Downloads/test.CSV";&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Do you know&amp;nbsp; how modify this routine and add your code to encode in UTF-8-BOM (if convert selection is UTF-8 for exemple) please ?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks you again !&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LuBa"&gt;routine_encoding.txt&lt;/A&gt;</description>
    <pubDate>Fri, 01 Feb 2019 10:17:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-02-01T10:17:57Z</dc:date>
    <item>
      <title>Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333249#M102052</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please i need some help.&lt;BR /&gt;I have to output a CSV file in UTF-8-&lt;STRONG&gt;BOM&amp;nbsp;&lt;/STRONG&gt;for my client, because in UTF-8 several special caracters are not encoding as well...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In this topic, I found a routine which can encode CSV file, but not in UTF-8-BOM...&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D73p000004kXNFCA2#M91288" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/Design-and-Development/tChangeFileEncoding-and-UTF8-encoding/m-p/149125#M91288&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please, somebody has a solution to this problem ?&lt;BR /&gt;&lt;BR /&gt;PS: not by passing with the custom component&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://www.talendforge.org/exchange/tos/extension_view.php?eid=328" target="_blank" rel="nofollow noopener noreferrer noopener noreferrer noopener noreferrer"&gt;tWriteHeaderLineToFileWithBOM&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:42:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333249#M102052</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T06:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333250#M102053</link>
      <description>&lt;P&gt;To do this you will need to add a bit code. I have just tested it, and it appears to work if you test the file here:&amp;nbsp;&lt;A href="https://validator.w3.org/i18n-checker/check#validate-by-upload+" target="_blank" rel="nofollow noopener noreferrer"&gt;https://validator.w3.org/i18n-checker/check#validate-by-upload+&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way to do this is to add a tJava to the beginning of your flow (before the file output component). Then add this code (or a variant of this code) to the tJava.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;String filename = "/Users/richardhall/Downloads/test.CSV";
String content="";
byte[] bytes = content.getBytes();
 
try (OutputStream out = new FileOutputStream(filename)) {
 
	// write a byte sequence
	out.write(0xEF);
	out.write(0xBB);
	out.write(0xBF);
        
	out.close();
} catch (IOException e) {
	e.printStackTrace();
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;You will also need to add these imports to the tJava's advanced settings...&lt;/P&gt;
&lt;PRE&gt;import java.io.FileOutputStream;
import java.io.OutputStream;&lt;/PRE&gt;
&lt;P&gt;What this does is create the file and adds 3 BOM bytes to the beginning of the file. The only change you need to make to the file output component is to set the file to Append and to not fail if the file already exists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 10:05:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333250#M102053</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T10:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333251#M102054</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp; thanks you for your answer !&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I don't understand how i can write the file path in the tJava before my file is created ?&lt;/P&gt; 
&lt;PRE&gt;String filename = "/Users/richardhall/Downloads/test.CSV";&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Do you know&amp;nbsp; how modify this routine and add your code to encode in UTF-8-BOM (if convert selection is UTF-8 for exemple) please ?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks you again !&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LuBa"&gt;routine_encoding.txt&lt;/A&gt;</description>
      <pubDate>Fri, 01 Feb 2019 10:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333251#M102054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T10:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333252#M102055</link>
      <description>&lt;P&gt;Sorry, that was my filepath I left in there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you set the filepath in your component with a context variable, just use the same context variable. Otherwise hard code it as I did in my test. Probably best to use a context variable though &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 10:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333252#M102055</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T10:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333253#M102056</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;ok thanks you.&lt;BR /&gt;So, I can put my file path (context variable) before the file exists ?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks !!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;PS:&lt;/P&gt; 
&lt;P&gt;I tried but doesn't work... CSV file generate is UTF8 not UTF8-BOM.&lt;/P&gt; 
&lt;P&gt;Opened with Excel, special caracters are not good (é = Ã©)...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LuKE"&gt;UTF8.JPG&lt;/A&gt;</description>
      <pubDate>Fri, 01 Feb 2019 11:55:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333253#M102056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T11:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333254#M102057</link>
      <description>&lt;P&gt;Check the file with the link I provided. That worked for me. I have no other way of testing, so maybe you can tell me how you tested. Run the job without the Java code and test the file with the link I gave. Then run the job with the code switched on and test the file. You should see that the BOM characters are recognised.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:47:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333254#M102057</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T12:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333255#M102058</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In my component tFileOutPutDelimited, how type of encoding i have to put ?&lt;/P&gt; 
&lt;P&gt;Have I to enable "write after" ? please&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks !&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;PS: i have tested, my component tFileOutputDelemited, convert the CSV file UTF-8-BOM to UTF-8...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;IT'S WORKED !! I have to enable&amp;nbsp;"write after"&amp;nbsp; in component&amp;nbsp;tFileOutPutDelimited !&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;thanks you so much !!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:57:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333255#M102058</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T12:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333256#M102059</link>
      <description>&lt;P&gt;No problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:46:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333256#M102059</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T13:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333257#M102060</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have just a last problem, with this solution i can't have the title in my csv...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Can you tell me how add it ?&amp;nbsp;&lt;BR /&gt;Maybe in the tJava, like out.write("TitleColumnA; TitleColumnB"); ??&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 14:49:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333257#M102060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T14:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333258#M102061</link>
      <description>&lt;P&gt;Why can't you add your title? I don't understand?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 16:15:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333258#M102061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T16:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333259#M102062</link>
      <description>&lt;P&gt;I don't know why title of my CSV column disapear...&lt;BR /&gt;&lt;BR /&gt;So i changed your tJava code for this code and it's work :&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;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();
}&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;Thanks you again&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 16:32:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333259#M102062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T16:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a CSV UTF-8 to UTF-8-BOM</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333260#M102063</link>
      <description>&lt;P&gt;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 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 20:28:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-a-CSV-UTF-8-to-UTF-8-BOM/m-p/2333260#M102063</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T20:28:10Z</dc:date>
    </item>
  </channel>
</rss>

