cancel
Showing results for 
Search instead for 
Did you mean: 

Unzip char conversion problems

inigo_sacramento
Participant
0 Kudos

Hi everyone.

I've got a zipped .txt that i unzip ussing PayloadZipBean module. It works fine but my problem is that i get some rare characters.

Instead of á or ó or ì, i get a ? or # and so long.

Does anybody know how to keep 'original' characters?

Regards,

Inigo.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Try using the MessageTransformBean to set the content type to the correct character set. Put the MessageTransformBean after the zip module. Set parameter: Transer.ContentType = text/plain;charset="ISO-8859-1"

Regards

Stefan

inigo_sacramento
Participant
0 Kudos

Hi Stefan.

I receive an attachment in a sender webservice. This attachment is a ZIP file that contains a TXT file inside.

What i have in file receiver adapter is :

localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean transform

localejbs/AF_Modules/PayloadZipBean Local Enterprise Bean zip

localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean contentType

CallSapAdapter Local Enterprise Bean 0

************************************************************************************++++

transform swap.keyName payload-name

transform swap.keyValue attachment-1

zip zip.mode unzip

contentType Transfer.ContentType text/plain;charset="ISO-8859-1"

With this, i still haven't got the correct characters (á, é, í, ó, ú, ò, è and so long)

Kind regards,

Inigo.

stefan_grube
Active Contributor
0 Kudos

Hi Inigo,

I am sorry, I have misspelled the paramter.

It should be: Transform.ContentType

See online help:

http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm

Regards

Stefan

inigo_sacramento
Participant
0 Kudos

Hi Stefan.

Even changing to Transform.ContentType i can't get the correct characters.

If i ZIP (not UNZIP) the payload, works fine.

Regards,

Inigo.

inigo_sacramento
Participant
0 Kudos

Hi again, Stefan.

The TXT file that is inside the ZIP file is an ANSI file.

If i change the ANSI to UTF-8, works. Well, it doesn't completely work because i got some strange chars. First one at the first position of the first line and second one, at the end position of the last line.

Any idea?

Kind regards,

Inigo

stefan_grube
Active Contributor
0 Kudos

Hi Inigo

I think the characters are just displayed wrong, it in fact they are correct.

What do you want to do with the attachement? Storing as file?

Or do you want to have any kind of file content conversion?

Regards

Stefan

inigo_sacramento
Participant
0 Kudos

Yes, storing as a file.

Stefan, you were rioght. Problem is viewing the file through AL11.

I get the file using ARCHIVSERVER_TO_FILE and the TXT file is 100% ok.

Many thanks.

Inigo.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Check out...

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

Regards

Arpil

Reward points for useful answers.

former_member190389
Active Contributor
0 Kudos

Are you using binary mode or text mode in the receiver communication channel. try using binary.

inigo_sacramento
Participant
0 Kudos

I've tried both text and binary with same result.

Regards,

Inigo

prateek
Active Contributor
0 Kudos

U may either try providing the character encoding in the file communication channel as ISO-8869-1 or try to use adapter module XmlAnonymizerBean with anonymizer.encoding = <charset>

Regards,

Prateek