Encode and Decode String in SAP UTF8 Format

* Encode and Decode String in SAP UTF8 Format.

Report Program

REPORT zab_encode_decode_utf8.

PARAMETERSp_string TYPE string.

DATAlv_encode TYPE xstring,
      lv_decode TYPE string.

WRITE'Plain string : ',p_string COLOR 1.


********************************************************
CALL METHOD cl_http_utility=>if_http_utility~encode_utf8
  EXPORTING
    unencoded p_string
  RECEIVING
    encoded   lv_encode.
WRITE'Encoded string : 'lv_encode COLOR 2.


********************************************************
CALL METHOD cl_http_utility=>if_http_utility~decode_utf8
  EXPORTING
    encoded   lv_encode
  RECEIVING
    unencoded lv_decode.
WRITE'Decoded string : 'lv_decode COLOR 3.

Input



Output



Comments

Popular posts from this blog

New syntax for append- VALUE (new syntax 7.4+) in ABAP

Read statement new syntax in ABAP. (7.4+).

Concatenation new syntax( 7.4+ ).