Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Special characters in UTF-8 UNIX file

Former Member
0 Kudos

We have a program which downloads data from certain info-types in to the UNIX file, Fields are written to the specific position in the UNIX file. Some of the fields contains "Special Characters" in them.

When we download the file in UTF-8 mode (encoding default) then the file display special characters correctly but the all the characters in that record gets shifted to left.

When we download the file in ANSI mode then the file display doesn't special characters correctly but the all the characters in that record do not get shifted from their place.

How can i find the special character in the field and accordingly i will shift the field right so that in the final UNIX file field won't shift their positions.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

UTF-8 encoding's code page is 4110

this might be helpfull for you

-Nishant

3 REPLIES 3

0 Kudos

Hi Ramnivas.

Have you tried to read the characters with class: CL_ABAP_CHAR_UTILITIES (transaction SE24, label Attributes)

For example you can see # in ABAP but in the file will be a new line or a carriage return, you can detect that an adapt it with:

CL_ABAP_CHAR_UTILITIES=>NEWLINE or CL_ABAP_CHAR_UTILITIES=>CR_LF

Other hand, if you are using OPEN DATASET to download the file, look at the options of encoding

See F1 of OPEN DATASET and then encoding..

OPEN DATASET - encoding

Syntax

... ENCODING { DEFAULT

| {UTF-8 [SKIPPING|WITH BYTE-ORDER MARK]}

| NON-UNICODE } ... .

Hope it helps

Regards.

Alfonso.

Former Member
0 Kudos

Hi Ramnivas,

Try this link

http://wiki.sdn.sap.com/wiki/display/ABAP/DownloadFileinUTF-8encoding

-Nishant

Former Member
0 Kudos

UTF-8 encoding's code page is 4110

this might be helpfull for you

-Nishant