cancel
Showing results for 
Search instead for 
Did you mean: 

UTF-8 Vs UTF-16

itabhishek9
Participant
0 Kudos

Hi,

I am trying to understand in what scenario can use different encoding schemes ex. UTF-16.

Based on my understanding when PI / PO picks up a file, it gets encoded using UTF-8 by default. Also an option is available in sender adapter of File type which when we select to Text, we can specify differetnt encoding like UTF-16. I have tried to using UTF-16 in the scenario which is working fine using File type as binary (default encoding as UF-8) and it stopped working and am able to see some funny characters in the payload. Can you please let me know why can't we use different encoding in this scenario.

Regards,

Abhishek

Accepted Solutions (0)

Answers (4)

Answers (4)

itabhishek9
Participant
0 Kudos

Thanks for your responses.

Can you please let me know how d I know the file that I am receiving from the partner is encodedinto which format. Can I understand the sameby opening the file or do we have any tool which will help us to do that.


stefan_grube
Active Contributor

Ask your partner about this information. File format and encoding is part of the specification and should not be "guessed".

RaghuVamseedhar
Active Contributor
0 Kudos

Abhishek,

If input file is UTF-16, then UFT-16 encoding should be used in SAP PI. If there is a miss-match, decoding will display wrong characters.

For more information check this blog

stefan_grube
Active Contributor
0 Kudos

I think you have understood something wrong. SAP PI tries to transform the encoding of the file to UTF-8. Therefore, you apply the source encoding to the channel. When your source file has encoding UTF-8, it does not make sense to put any other value here. If you want to receive a UTF-16 file, you can use a receiver file adapter and put the target encoding as UTF-16, that will work.

former_member182412
Active Contributor
0 Kudos

Hi Abhishek,

If you have the the characters which occupy 2 bytes example Japanese characters then you need to use UTF-16, if you have the characters which occupy one byte then you can use UTF-8.

If you want more about UTF-8 and UTF-16 check below link.

http://stackoverflow.com/questions/4655250/difference-between-utf-8-and-utf-16

Regards,

Praveen.