<?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: Change encoding in ESB route (UTF-8 to Windows-1252) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299127#M71511</link>
    <description>OK, I think we are nearly there. This is slightly more complicated than I had first thought. Take a look at the accepted answer here ( 
&lt;A href="http://stackoverflow.com/questions/28484064/windows-1252-to-utf-8" rel="nofollow noopener noreferrer"&gt;http://stackoverflow.com/questions/28484064/windows-1252-to-utf-8&lt;/A&gt;). It seems to make sense. It is doing the reverse of what you are doing, but should be easy enough to get it to do what you want.</description>
    <pubDate>Tue, 03 May 2016 14:14:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-03T14:14:09Z</dc:date>
    <item>
      <title>Change encoding in ESB route (UTF-8 to Windows-1252)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299123#M71507</link>
      <description>Hello everybody, 
&lt;BR /&gt;This is my first message on the forum 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;. 
&lt;BR /&gt;I want to convert a file from the "UTF-8" format to the "windows-1252"/"Cp1252" format in Talend route. 
&lt;BR /&gt;I tested the best solution for me. 
&lt;BR /&gt;- Start component: cFtp 
&lt;BR /&gt;I indicate&amp;nbsp;the "utf-8" charset in the advanced options, the charset of my file. 
&lt;BR /&gt;- Middle component: cConvertBody 
&lt;BR /&gt;I indicate the class: "byte[].class, "Cp1252"" 
&lt;BR /&gt;- End component: CFtp 
&lt;BR /&gt;I indicate the "Cp1252" charset, the&amp;nbsp;encoding in which I want my file. 
&lt;BR /&gt;This method doesn't work and i'm little desperate. Do you have an idea to help me ? 
&lt;BR /&gt;Thank you in advance. 
&lt;BR /&gt;PS:&amp;nbsp;I included in the attach documents, the options of my components. 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/356580/Start_component.jpg.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME3e.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131702i283A92DE884F7F62/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME3e.jpg" alt="0683p000009ME3e.jpg" /&gt;&lt;/span&gt;&amp;nbsp; &lt;/A&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/356580/end.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDxX.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140191i248292FF7ED23836/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDxX.jpg" alt="0683p000009MDxX.jpg" /&gt;&lt;/span&gt; &lt;/A&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/356580/route.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME3j.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145656iFA3A8B8CBE49FCC3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME3j.jpg" alt="0683p000009ME3j.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/A&gt;</description>
      <pubDate>Sat, 16 Nov 2024 10:39:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299123#M71507</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Change encoding in ESB route (UTF-8 to Windows-1252)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299124#M71508</link>
      <description>I have not done this before, but was interested in your problem. I don't believe you will be able to do this in the way you are trying (however, I may be wrong). What I would attempt is making use of a cProcessor component and trying to do the conversion in Java.
&lt;BR /&gt;Take a look at this site (
&lt;A href="http://java67.blogspot.co.uk/2015/05/how-to-convert-byte-array-to-string-in-java-example.html" rel="nofollow noopener noreferrer"&gt;http://java67.blogspot.co.uk/2015/05/how-to-convert-byte-array-to-string-in-java-example.html&lt;/A&gt;) for an example of how to convert a byte[] to a String of a particular encoding. 
&lt;BR /&gt;However, before you do that, you need to get the data as a byte[].&amp;nbsp;
&lt;BR /&gt;A byte is a primitive type in Java. It is not a class. Therefore your&amp;nbsp;
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;byte[].class&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;conversion won't work. You need to convert the type to a String.class. Then the next component should be the cProcessor. Once in the cProcessor you can get hold of your data using code similar to below....
&lt;BR /&gt;
&lt;PRE&gt;String myString = exchange.getIn().getBody(String.class);&lt;/PRE&gt;
&lt;BR /&gt;You can then refer to the post below, to convert the String to a byte[] in the cProcessor.
&lt;BR /&gt;
&lt;A href="http://stackoverflow.com/questions/18571223/how-to-convert-java-string-into-byte" rel="nofollow noopener noreferrer"&gt;http://stackoverflow.com/questions/18571223/how-to-convert-java-string-into-byte&lt;/A&gt;
&lt;BR /&gt;Then use the post I gave in the first paragraph (
&lt;A href="http://java67.blogspot.co.uk/2015/05/how-to-convert-byte-array-to-string-in-java-example.html" rel="nofollow noopener noreferrer"&gt;http://java67.blogspot.co.uk/2015/05/how-to-convert-byte-array-to-string-in-java-example.html&lt;/A&gt;) to convert the encoding.&amp;nbsp;
&lt;BR /&gt;Then use code very similar to below to put your newly converted String back into the body....
&lt;BR /&gt;
&lt;PRE&gt;exchange.getIn().setBody(myConvertedString);&lt;/PRE&gt;
&lt;BR /&gt;Then the next component *should* have the converted String in the message.
&lt;BR /&gt;As I said, I have not tried this, but I suspect that this (or a slight variant on this) logic should work for you.
&lt;BR /&gt;I'd be interested to hear if it does.</description>
      <pubDate>Sun, 01 May 2016 23:41:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299124#M71508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-01T23:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change encoding in ESB route (UTF-8 to Windows-1252)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299125#M71509</link>
      <description>It turns out I may have been wrong in my assertion that you can't do what you want in the way you want.....although the way I suggested should work (....the long way around &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ).&amp;nbsp;</description>
      <pubDate>Mon, 02 May 2016 20:10:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299125#M71509</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-02T20:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change encoding in ESB route (UTF-8 to Windows-1252)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299126#M71510</link>
      <description>Hello rhall_2.0, 
&lt;BR /&gt;Thank you very much for you answer ! 
&lt;BR /&gt;I tried with your method. 
&lt;BR /&gt;cFtp -&amp;gt; cConvertBody (String.class) -&amp;gt; cProcessor (look below)&amp;nbsp;-&amp;gt; cFtp 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/356580/Capture.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME3o.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131264iA1F4BF24A14A003D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME3o.jpg" alt="0683p000009ME3o.jpg" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt;After this route, the file without punctuations (I am French, punctuations is used) have the&amp;nbsp;"ANSI as UTF-8" format but&amp;nbsp;if I add an "é","è","à".... in the file, it have the "ANSI" format. 
&lt;BR /&gt;The format "ANSI as UTF-8" is (certainly) present because of the correspondence characters&amp;nbsp;between the UTF-8 and the ANSI. 
&lt;BR /&gt;I have doubts about the solution, Do you believe that this is normal? Again thank you for your help</description>
      <pubDate>Tue, 03 May 2016 10:04:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299126#M71510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-03T10:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Change encoding in ESB route (UTF-8 to Windows-1252)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299127#M71511</link>
      <description>OK, I think we are nearly there. This is slightly more complicated than I had first thought. Take a look at the accepted answer here ( 
&lt;A href="http://stackoverflow.com/questions/28484064/windows-1252-to-utf-8" rel="nofollow noopener noreferrer"&gt;http://stackoverflow.com/questions/28484064/windows-1252-to-utf-8&lt;/A&gt;). It seems to make sense. It is doing the reverse of what you are doing, but should be easy enough to get it to do what you want.</description>
      <pubDate>Tue, 03 May 2016 14:14:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Change-encoding-in-ESB-route-UTF-8-to-Windows-1252/m-p/2299127#M71511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-03T14:14:09Z</dc:date>
    </item>
  </channel>
</rss>

