cancel
Showing results for 
Search instead for 
Did you mean: 

ANSI to UTF-8 conversion

Former Member
0 Kudos

Hello All,

I'm trying to convert a text file from ASNI to UTF-8

my sender is a sftp and receiver is file(nfs),

I'm trying to convert in the encoding in the receiver adapter.

I tried both the methods,

using AF_Modules/MessageTransformBean text/plain;charset=ISO-8859-1

"AF_Modules/TextCodepageConversionBean" UTF-8

or even specifying  "Filetype" Text (UTF-8)

the message shows successful, show the following..

Conversion: converting codepage from ISO-8859-1 to utf-8


but still the file encoding is shown as ANSI when viewed in the textpad editor.

or even try to open the file in AL11 it shows "#" symbol.


am I missing anything? I saw many blogs but didn't help me.


Regards,

George

Accepted Solutions (0)

Answers (2)

Answers (2)

Andrzej_Filusz
Contributor
0 Kudos

Hi George,

Could you add screenshot of "Module" tab in your communication channel please?

I'm interested in "Processing Sequence" and "Module Configuration".

It will be much easier to help you.

Regards,

Andy

Former Member
0 Kudos

Hi Andy,

Here is my com.channel module configuration

and the message log shows the conversion successful.

but the file still shows as ANSI.

regards,

George

RaghuVamseedhar
Active Contributor
0 Kudos

George,

1. I think entries Module Key "readfile" and "encoding" are redundant. Please remove them and test.

2. Source systems is sending ASCII characters, so target file will be considered as ASCII file. You can force target to consider it as UTF-8 by adding BOM to starting of file. Example 4 in this blog

Former Member
0 Kudos

Hi Raghu,

thanks for your reply, I added the redundant module to trap the sequence in the message log, it works the same with or without having it.

just to understand as in the example, it indicates to create a java mapping..! is this the only way to force the file?

RaghuVamseedhar
Active Contributor
0 Kudos

George,

Here input is ASCII, it has only 127 characters. It will be same in ASCII, CP1252, ISO 8859-1 and UTF-8 (uses 1 byte).

Two ways to let target know target file is UTF-8 encoded

1. In mapping add character which needs 2 or more bytes in UTF-8. Like, add a to target data.

2. Add BOM at starting of file (using Java Map) to force target to think it is UFT-8 encoded.

http://www.asciitable.com/

https://en.wikipedia.org/wiki/UTF-8

http://unicode-table.com/en/#00FF

former_member186851
Active Contributor
0 Kudos

Hello George,

Try opening in Notepad+++ ,changing the encoding.