Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

xstring converion issue

Former Member
0 Likes
468

Hello ,

I have a requirement to convert xstring to Text . below mentioned is code i am using for conversion

TRY.

CALL method cl_abap_conv_in_ce=>create

EXPORTING

encoding = 'UTF-8'

input = p_detailtext ( xstring format)

receiving

conv = lv_convert.

CALL method lv_convert->read

IMPORTING

data = lv_string. ( text format )

CATCH cx_root.

lv_msg = 'Conversion error'.

ENDTRY.

this code workings absolutely fine for normal text . But if the text has special characters like £ , ¥ , then an exception is raised and I just get back a # instead .

Could anyone help in this regard . How do i get the right conversion for all characters.

1 ACCEPTED SOLUTION
Read only

ahofius
Explorer
0 Likes
437

Hi,

it seems that your input xstring is not in UTF-8 format.

You should check this.

Best regards,

Armin Hofius

2 REPLIES 2
Read only

ahofius
Explorer
0 Likes
438

Hi,

it seems that your input xstring is not in UTF-8 format.

You should check this.

Best regards,

Armin Hofius

Read only

Former Member
0 Likes
437

I resolved the issue , as i came to close the query i saw ur reply. You are absolutely right the format xstring i was receving was not UTF-8 format. Now as the portal is handling it it comes thru' fine /

thanks