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: 

Unicode - problem

jrgkraus
Active Contributor
0 Kudos

Hello to all,

I am looking for a way to check whether a given character in a unicode system can be converted into a certain codepage or not. Maybe there is even a function module, that marks all the non-printable characters in a string with the '#'-sign...

thangs for researching

Jörg

1 ACCEPTED SOLUTION

Clemenss
Active Contributor
0 Kudos

Hi Jörg.

TRANSLATE c TO CODE PAGE g2.

should raise a sy-subrc <> 0 if not convertible.

Regards,

Clemens

2 REPLIES 2

Former Member
0 Kudos

Hi,

4-digit number of the SAP codepage. The function module SCP_CODEPAGE_BY_EXTERNAL_NAME provides the SAP codepage number for an external character set name, for example, "iso-8859-1". The function module NLS_GET_FRONTEND_CP provides the respective non-Unicode frontend codepage for a language.

The desired codepage can be determined interactively, if the parameter with_encoding of method file_open_dialog is set by cl_gui_frontend_services.

If the specified codepage is not suited for the Byte Order Mark of the file, an exception is triggered.

SPACE: Codepage of the frontend operating system

<b>Reward points</b>

Regards

Clemenss
Active Contributor
0 Kudos

Hi Jörg.

TRANSLATE c TO CODE PAGE g2.

should raise a sy-subrc <> 0 if not convertible.

Regards,

Clemens