Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting WinHttpRequest response to application code
Message
From
10/02/2023 06:51:46
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
10/02/2023 06:01:00
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01686154
Message ID:
01686178
Views:
32
>>>Returns question mark.
>>>Result should be Ü character, single byte 0xDC. Those 4 bytes per character are returned in WinHttpRequest.ResponseText. How to get 0xDC result ?
>>
>>Possibly the result you are getting is double width text, so you may need to do strconv() twice - first utf8 to double width, then that to 1257, I think the parameter is 2. I think I had cases when I had to do that (in my case, to 1250).
>
>Strconv() Parameter 2 does not accept code page. It requires locale id. Baltic locale id is not documented.
>
>Tried
>
>
>FOR i=1 TO 99999
>  cres='?'
>  ON ERROR note
>  cres = STRCONV( strconv(CHR(0xc3)+CHR(0x83)+ CHR(0xc2)+CHR(0x9c) ,11) ,2,i)
>  ON ERROR
>
>IF cres#'?'
>  ? i, cres
>  ENDIF
>
>ENDFOR
>
>
>This does not return any value.
>How to use your suggestion?

I've found that I've used STRCONV(STRCONV(lcText,11),2) without codepage, relying on it being set as the default (codepage for non-unicode apps in windows control panel).

In some cases, when I had to convert from 1250 to utf8, I had to do this:
lcTekst=Strconv(lcTekst,1)
lcTekst=Strconv(lcTekst,9,1250,1)
the last parameter means that the third parameter is a codepage, or else it may mean locale id. I never had much luck with locale ids.
I think all of 9,10,11 and 12 strconv()'s 2nd parameters take the third and fourth parameter the same way. So perhaps

STRCONV(STRCONV(lcText,11, 1257,1),2)

would be the ticket. Don't have a proper way to test it, but you do.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform