Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

WAD utf8decode string only results in ? chars

Dec
73
1
The rather "limited" utf8 support in tcc wouldn't be so bad if you could force a conversion on input/output and otherwise treat stings with the default non-utf codepage. At least @UTF8ENCODE[s,...] works fine, but %@UTF8DECODE[s,...] only returns ? chars whatever code page I've set. The manual reads:

"@UTF8DECODE[s,string] : Create a text string (using the current code page) from a UTF8 input string. Returns the text string."

But if I run the attached utf8-encoded batch file containing a test string I get
Active code page: 1252
Test???????
Active code page: 850
Test???????
Active code page: 65001
Test???????
Active code page: 437
Test???????

How is @UTF8DECODE[s,...] supposed work, am I missing something here?
 

Attachments

  • bug.bat
    155 bytes · Views: 256
In v17, the batch file is recognized as UTF8, and the string has already been converted from UTF8 before calling @UTF8DECODE.

Right, thanks. That's certainly not self-explanatory, maybe an addition to the @UTF8DECODE function in the help might be appropriate.
 

Similar threads

Back
Top