2007 Mar 12 9:55 AM
Hi,
I tried<b> encoding few japanese</b> letters using this below API. system is "<b>UNICODE</b>" enabled.
lv_final_oppt_txt = "日本テスト日本テスト".
CALL METHOD cl_http_utility=>encode_base64
EXPORTING
unencoded = lv_final_oppt_txt
RECEIVING
encoded = lv_text.
<b>Once after decoding this</b> , i am not getting a proper text out of it.
I have used this below API for decoding.
CALL METHOD cl_http_utility=>decode_base64
EXPORTING
encoded = lv_text
RECEIVING
unencoded = lv_final.
<b>Finally lv_final will have corrupted data like "########".</b>
Can you please tell me how do I go about it..or is there any API which works for all
the character sets..This Base64 encoding API works only for nonunicode system I
suppose..<b>Kindly let me know if u know any base64 encoding API which works for all the character sets..</b>
Thanks,
Shiva.<b></b>
Hi,
I tried<b> encoding few japanese</b> letters using this below API. system is "<b>UNICODE</b>" enabled.
lv_final_oppt_txt = "日本テスト日本テスト".
CALL METHOD cl_http_utility=>encode_base64
EXPORTING
unencoded = lv_final_oppt_txt
RECEIVING
encoded = lv_text.
<b>Once after decoding this</b> , i am not getting a proper text out of it.
I have used this below API for decoding.
CALL METHOD cl_http_utility=>decode_base64
EXPORTING
encoded = lv_text
RECEIVING
unencoded = lv_final.
<b>Finally lv_final will have corrupted data like "########".</b>
Can you please tell me how do I go about it..or is there any API which works for all
the character sets..This Base64 encoding API works only for nonunicode system I
suppose..<b>Kindly let me know if u know any base64 encoding API which works for all the character sets..</b>
Thanks,
Shiva.<b></b>
2010 Feb 22 10:38 PM
Here's how you can encode and decode base64 string:
DATA : lv_intial TYPE string,
lv_encoded TYPE string,
lv_final TYPE string,
lv_tmp1 TYPE xstring,
lv_tmp2 TYPE xstring.
lv_intial = 'u65E5u672Cu30C6u30B9u30C8u65E5u672Cu30C6u30B9u30C8'.
* convert string to xstring for use with base64 call
lv_tmp1 = cl_openxml_helper=>string_to_xstring( lv_intial ).
* convert temporary xstring to base64 encoded string
lv_encoded = cl_http_utility=>encode_x_base64( lv_tmp1 ).
* decode encoded string into xstring
lv_tmp2 = cl_http_utility=>decode_x_base64( lv_encoded ).
* convert xtring back to UTF-8
lv_final = cl_openxml_helper=>xstring_to_string( lv_tmp2 ).
WRITE:/ 'Initial :', lv_intial,
/ 'Encoded :', lv_encoded,
/ 'Decoded :', lv_final.