<?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: encoding problem with positional files : java in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309647#M80845</link>
    <description>I have created new bug request 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCk07CAC" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/Exception-on-BLOB-and-CLOB-data-types/td-p/71398&lt;/A&gt; 
&lt;BR /&gt;thanks</description>
    <pubDate>Fri, 26 Oct 2007 06:41:25 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2007-10-26T06:41:25Z</dc:date>
    <item>
      <title>encoding problem with positional files : java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309644#M80842</link>
      <description>If I want to read a field of a positional file as a byte array, Talend is generating code like
&lt;BR /&gt; columnValuetFileInputPositional_1.getBytes();
&lt;BR /&gt;I believe getBytes method, with out any arguments, will use default "Cp1252" encoding (JVM default)
&lt;BR /&gt;So, in order to read "ISO-8859-15" encoded files it should generate code like
&lt;BR /&gt; ...getBytes("ISO-8859-15") with charset name as an argument.
&lt;BR /&gt;Other solution would be, change the JVM default encoding.
&lt;BR /&gt;I know how to change this while running the job using "bat" file
&lt;BR /&gt;( java -Dfile.encoding=ISO-8859-15 -Xms256M -Xmx1024M ...)
&lt;BR /&gt;But i dont know how to set JVM's Default encoding inside TALEND.
&lt;BR /&gt;I have tried setting window&amp;gt;preferences&amp;gt;General&amp;gt;workspace&amp;gt; Text file Encoding&amp;gt; to "ISO-8859-15". but this is not working as I am getting wrong results.
&lt;BR /&gt;I am getting correct result if I export the same job and run by changing the bat file ( java -Dfile.encoding=ISO-8859-15 -Xms256M -Xmx1024M ...) .
&lt;BR /&gt;Can you help me 
&lt;BR /&gt;Thanks and Regards
&lt;BR /&gt;Sasi</description>
      <pubDate>Sat, 16 Nov 2024 14:32:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309644#M80842</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T14:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: encoding problem with positional files : java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309645#M80843</link>
      <description>-Dfile.encoding=ISO-8859-15 VM argument is working with eclipse but not working with TALEND.&lt;BR /&gt;May i know why?</description>
      <pubDate>Thu, 25 Oct 2007 06:30:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309645#M80843</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-10-25T06:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: encoding problem with positional files : java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309646#M80844</link>
      <description>Hi 
&lt;BR /&gt;I have tested a job as you said and found that it's a bug. Can you report a bug in our bugtracker please?
&lt;BR /&gt;Thanks for your support!
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
      <pubDate>Thu, 25 Oct 2007 09:13:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309646#M80844</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-10-25T09:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: encoding problem with positional files : java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309647#M80845</link>
      <description>I have created new bug request 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCk07CAC" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/Exception-on-BLOB-and-CLOB-data-types/td-p/71398&lt;/A&gt; 
&lt;BR /&gt;thanks</description>
      <pubDate>Fri, 26 Oct 2007 06:41:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309647#M80845</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-10-26T06:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: encoding problem with positional files : java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309648#M80846</link>
      <description>I think there can be a bug in your job related with the encoding. (fixed for example in the lastest version) 
&lt;BR /&gt;As you can see there is an encoding directly in the component (this one should be enough), I think you should try to switch this value of encoding. Maybe just like switch to UTF8 then switch back in ISO-8859-15, then run again the job. 
&lt;BR /&gt;(nb: seems it needs to switch to built-in property mode before use the switch encoding in the version 2.1.1 (used for your bug report)) 
&lt;BR /&gt;About the VMs argument, i think it will be added but as a feature. This will be added certainly in the preferences of TOS directly to avoid to interfer with the eclipse parameters.</description>
      <pubDate>Fri, 26 Oct 2007 08:42:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309648#M80846</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-10-26T08:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: encoding problem with positional files : java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309649#M80847</link>
      <description>I guess the problem is not with reading of file. TALEND reads the file correctly with correct encoding specified. 
&lt;BR /&gt;intFileInputPositional_1 = new java.io.BufferedReader( 
&lt;BR /&gt; new java.io.InputStreamReader(new java.io.FileInputStream(String) ((String) context.getProperty("datadir")) + (String) ((String) context.getProperty("sourceTableOrFileNames"))), "ISO-8859-15")); 
&lt;BR /&gt;After this , I am reading a field as byte array. 
&lt;BR /&gt;For this, talend first reads the field as a string and then calls .getBytes() method on that string to get byte array. 
&lt;BR /&gt;I am not getting correct results with this. 
&lt;BR /&gt;If i read input field as string and then call .getBytes("ISO-8859-15") method on that string manually, I am getting correct results. 
&lt;BR /&gt; 
&lt;BR /&gt;Problem is getBytes() method without arguments, will use default encoding(Cp1252 on my windows). 
&lt;BR /&gt;I have tried this on 2.2 version also and result is same. 
&lt;BR /&gt;Talend starting JVM with default encoding irrespective of VM arguments. 
&lt;BR /&gt;So the solution would be either we call .getBytes() method with correct encoding as argument or, 
&lt;BR /&gt;start the JVM with the proper encoding. 
&lt;BR /&gt; (If i export the same talend job, not working in TALEND, then change the bat file to have file.encoding VM argument and run the job , i am getting correct results.) 
&lt;BR /&gt;So as a workaround, I am reading all the fields as strings and then calling .getBytes("ISO-8859-15") method manually. 
&lt;BR /&gt;Correct me if I am wrong. 
&lt;BR /&gt;Thanks and regards, 
&lt;BR /&gt;Sasi</description>
      <pubDate>Fri, 26 Oct 2007 10:18:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309649#M80847</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-10-26T10:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: encoding problem with positional files : java</title>
      <link>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309650#M80848</link>
      <description>Sasi, 
&lt;BR /&gt;The good solution is too correct encoding used with the .getBytes() method to not affect others encoding options.
&lt;BR /&gt;I will update your 2349.
&lt;BR /&gt;
&lt;BR /&gt;Thanks for your support,</description>
      <pubDate>Sat, 27 Oct 2007 00:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/encoding-problem-with-positional-files-java/m-p/2309650#M80848</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-10-27T00:57:43Z</dc:date>
    </item>
  </channel>
</rss>

