When I read a XML using NETWEBGET, Special characters are not read properly. For example Á=á, É=é...
Is there any solution to this? :nw:
I guess is something issue with unicode convertning or such ting, which is unsupported by GlBasic. I guess the string have been formated to Utf8 by system, and then glbasic not checking about format, and fail to convert back again (its my guess).
I think you should give a example code.....
It depends on the encoding of this website. If it's UTF-8, you have to convert it back to ISO-88xx or so.
You can try: "URLDECODe$", which does this (as well as expanding "+" to " ").
Optionally, you could call an inline function:
void __GLBASIC__::_utf8decode_glb(DGStr& str);
The XML file I have to read is located on a server outside so I can not handle it, the only option would be that GLB could read it in UTF-8.
How I would use "void __GLBASIC__: _utf8decode_glb (DGStr & str);"?
LOCAL utf8$ = "Superäöüsuper" // superäöüsuper
STDOUT fromUtf8$(utf8$) + " - äöü\n"
KEYWAIT
FUNCTION _end_main_foo:
ENDFUNCTION
INLINE
void _utf8decode_glb(DGStr& str);
ENDINLINE
FUNCTION fromUtf8$: str$
INLINE
_utf8decode_glb(str_Str);
ENDINLINE
RETURN str$
ENDFUNCTION
I'll try
Thank you very much. You're still the best :nw: :nw:
That comes up with "Super super - äöü" using DEBUG and "Super super - õ÷³" using STDOUT
for STDOUT the console-codepage usually is set to Windows. There are ways to change it, but it's just a matter of display.
I presume that function converts to unicode where available ?
No. There's no unicode used at all.