‎2010 Sep 06 4:13 PM
Hi guys,
sorry for this question, but I was looking on Google and probably I'm working with wrong key words, cause I cannot find any help for my problem.
In my example I'm working with 1 special letter but it can be any "non ASCII" letter from UNICODE table.
Novák is name of author of the book.
I'm sending some http request by POST method to ALEPH server (it is library system).
http://www.mysite.com/X?op=find&&request=wau=novák&base=xxx01
Important part of my question is the letter á (czech letter): request=wau= novák.
Now I need to send it in this form: request=wau= nov%c3%a1k
but after conversion by
lv_string = cl_http_utility=>escape_url( i_uri ).
.
I've got that result: lv_string = nov%e1k.
The same result I've got with FM WWW_URLENCODE
How I can get the HEX code with percents into my http request please?
Thanks a lot for any help
Petr
‎2010 Sep 06 7:35 PM
Hello Petr!
You can create a custom FM like 'ZWWW_URLENCODE' with the same code of the original. And force the variable :
gui_codepage to '4110'.
Extract of the code :
* if we have a unicode codepage use utf-8
IF gui_codepage EQ '4103' OR gui_codepage EQ '4102' OR
gui_codepage EQ '4101' OR gui_codepage EQ '4100'.
gui_codepage = '4110'.
ENDIF.
*Begin Modification Petr
gui_codepage = '4110'.
*End Modification Petr
* create a converter object using the frontend codepage
encode = gui_codepage.
conv = cl_abap_conv_out_ce=>create( encoding = encode ).This will convert the URL to UTF-8.. so novák will be nov%c3%a1k.
Best Regards.
Claudio (Aparatey)
‎2010 Sep 06 7:35 PM
Hello Petr!
You can create a custom FM like 'ZWWW_URLENCODE' with the same code of the original. And force the variable :
gui_codepage to '4110'.
Extract of the code :
* if we have a unicode codepage use utf-8
IF gui_codepage EQ '4103' OR gui_codepage EQ '4102' OR
gui_codepage EQ '4101' OR gui_codepage EQ '4100'.
gui_codepage = '4110'.
ENDIF.
*Begin Modification Petr
gui_codepage = '4110'.
*End Modification Petr
* create a converter object using the frontend codepage
encode = gui_codepage.
conv = cl_abap_conv_out_ce=>create( encoding = encode ).This will convert the URL to UTF-8.. so novák will be nov%c3%a1k.
Best Regards.
Claudio (Aparatey)
‎2010 Sep 07 9:07 AM
Thank you very very much, now it is working and SOLVED.
I'm trying to give you points but I cannot find a yellow star.
Edited by: Petr Hodbod on Sep 7, 2010 10:17 AM
‎2010 Sep 07 9:26 AM