cancel
Showing results for 
Search instead for 
Did you mean: 

File encoding with UTF-8

jean-philippe_pain2
Participant
0 Kudos

Hello all,

My scenario is IDoc -> XI -> File (txt).

Everything was working fine until i have to handle eastern european language with weird symbol

So in my file adapter receiver, i'm using the file encoding code UTF-8 and when i look my field in output, everything is fine.

BUT, when i look in binary, the length of these field is not longer fixed because a special character takes 2 bytes instead of one.

I would like to know if it's possible to handle those characters with a file encoding code UTF-8 in a fixed length field of 40 characters for example don't want a variable length for my fields...

Thanks by advance,

JP

Accepted Solutions (1)

Accepted Solutions (1)

jean-philippe_pain2
Participant
0 Kudos

I agree with you. In XI, i don't have this problem, i have it in my ouput file when i edit my text file in binary mode !

My field should be on 40 characters but the special symbol which take 2 bytes instead of 1 make the length of my output fields variable !!!

My question was to know if there is a way to have a fixed length in my output file..

Sorry if i wasn't clear in my first post.

JP

stefan_grube
Active Contributor
0 Kudos

UTF-8 is a variable byte format. A character could have 1-4 bytes.

If you want to have fix length, you have to use fix length encoding.

For eastern europe you could have for example ISO-8859-2

Check wikipedia für details on utf-8 and ISO-8859-2

Regards

Stefan

Answers (2)

Answers (2)

jean-philippe_pain2
Participant
0 Kudos

Thanks Stefan, it works now !

prateek
Active Contributor
0 Kudos

XI handles the characters not in bytes but directly in character format. So you need not worry about encoding. UTF-8 will work. Use simply the character count for your case.

Regards,

Prateek