Encode and Decode String in SAP UTF8 Format

* Encode and Decode String in SAP UTF8 Format.

Report Program

REPORT zab_encode_decode_utf8.

PARAMETERS: p_string TYPE string.

DATA: lv_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

Custom entity/Action dialog in RAP using Unmanaged scenario

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

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