Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Obsolete Language Elements →  Obsolete Processing of Internal Data →  Obsolete Character String and Byte String Processing 

Obsolete Methods for Handling Code Pages

The class CL_ABAP_CODEPAGE contains methods for converting the representation of character strings between different code pages. The interface IF_ABAP_CODEPAGE enables objects in the class to be accessed.

Other versions: 7.31 | 7.40 | 7.54


Note

The methods CONVERT of the interfaces IF_ABAP_CONV_OUT and IF_ABAP_CONV_IN are more robust than the methods of the class CL_ABAP_CODEPAGE and have replaced them.


Example

This example demonstrates a conversion of strings to their UTF-8 representation and back. The interface methods CONVERT replace the methods CONVERT_TO and CONVERT_FROM of the class CL_ABAP_CODEPAGE.

DATA(xstr_new) = 
  cl_abap_conv_codepage=>create_out(  )->convert( `Blahblah` ). 
DATA(xstr_old) = 
  cl_abap_codepage=>convert_to( `Blahblah` ). 
ASSERT xstr_new = xstr_old. 

DATA(text_new) = 
  cl_abap_conv_codepage=>create_in( )->convert( xstr_new ). 
DATA(text_old) = 
  cl_abap_codepage=>convert_from( xstr_old ). 
ASSERT text_new = text_old.