tChangeFileEncoding

One Star

tChangeFileEncoding

Hello,
I am trying to use the tChangeFileEncoding component without specifying the input encoding format.
What does this component exatly do it that case?
Does it determine itself the input encoding format ?
Currently, if I try to convert an ANSI text file to UTF-8 using this component, all accentuated caracters are currupted.

rgds
JL Lecardinal
Moderator

Re: tChangeFileEncoding

Hi,
If you use the tChangeFileEncoding component without specifying the input encoding format, it will get your system encoding by default.
java.io.BufferedReader in_tChangeFileEncoding_1 = new java.io.BufferedReader(
new java.io.InputStreamReader(
new java.io.FileInputStream(
sOriFileN_tChangeFileEncoding_1),
System.getProperty("file.encoding")));

I have make a test for converting an ANSI text file to UTF-8 using this component, but there is an exception popped up.
Exception in component tChangeFileEncoding_1
java.io.UnsupportedEncodingException: ANSI
at sun.nio.cs.StreamDecoder.forInputStreamReader(Unknown Source)
at java.io.InputStreamReader.<init>(Unknown Source)
at demo.changefileencoding_0_1.ChangeFileEncoding.tChangeFileEncoding_1Process(ChangeFileEncoding.java:294)
at demo.changefileencoding_0_1.ChangeFileEncoding.runJobInTOS(ChangeFileEncoding.java:520)
at demo.changefileencoding_0_1.ChangeFileEncoding.main(ChangeFileEncoding.java:388)
connecting to socket on port 3515
connected
disconnected
Job ChangeFileEncoding ended at 12:28 11/12/2012.

I doubt that we cannot support this Encoding.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Seventeen Stars

Re: tChangeFileEncoding

It is called ASCII not ANSI.
Moderator

Re: tChangeFileEncoding

Hi,
It is called ASCII not ANSI.

@jlolling, you are so great! If it is ASCII, we can support that. I also wonder what is "ANSI"....
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.