ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Character String and Byte String Processing → Character and Byte String Processing - Overview
Character Strings and Byte ChainsOther versions: 7.31 | 7.40 | 7.54
Character-like data objects contain character strings. A character-like data object either has a character-like data type
string) or it is a date/time type (
t), or it is a
flat structure with exclusively character-like components.
ABAP supports the character format UCS-2 and a character always occupies two bytes. This ensures that all characters from the system code page UTF-16 are handled correctly (except for those in the surrogate area). These characters occupy four bytes and hence are handled as two characters by ABAP. This can produce unexpected results when cutting character strings or comparing individual characters in character sets.
Byte-like data objects contain byte chains (or byte strings). A byte-like data object always has the byte-like data type
A byte string of type
xstring contains a byte chain, which is decoded in accordance with codepage UTF-8 into a text in a text string of type
DATA hex TYPE xstring VALUE '48656C6C6F20576F726C64'. DATA text TYPE string. text = cl_abap_conv_codepage=>create_in( )->convert( hex ). cl_demo_output=>display( text ).