Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Character String and Byte String Processing →  System Classes for Character String and Byte String Processing 

Methods for Handling Code Pages

The methods CONVERT of the interfaces IF_ABAP_CONV_OUT and IF_ABAP_CONV_IN of objects created with the class CL_ABAP_CONV_CODEPAGE make it possible to convert strings to the binary representation of various code pages (and back again).

Other versions: 7.31 | 7.40 | 7.54


Converts the content of a string into its UTF-8 representation. The value "UTF-8" is the default value for the parameter CODEPAGE and can be omitted if required. The statement ASSERT shows that the reverse conversion creates the original text.

DATA(str) = `Blah blah ...`. 

DATA(xstr) = 
  cl_abap_conv_codepage=>create_out( codepage = `UTF-8` 
    )->convert( source = str ). 

  cl_abap_conv_codepage=>create_in( codepage = `UTF-8` 
    )->convert( source = xstr ) = str.