DebuggerWarning does not support Unicode
Posted: Fri Oct 18, 2024 3:28 am
I don't understand why DebuggerWarning doesn't support the Unicode string. Instead of a message there is a question mark ????????
http://www.purebasic.com
https://www.purebasic.fr/english/
My translation files are all UTF-8 with BOM. For example, this code doesn't work:AZJIO wrote: Fri Oct 18, 2024 6:05 am 1. Can you give me a code to check that is guaranteed to give the problem?
2. Check that the “Catalogs\Russian” files are in UTF-8 encoding.
I had the problem sometimes, but I put off researching the cause. Now I checked that my files were in Win1251 encoding. Now if you give me an example, I'll check that it will give me squares instead of meaningful text.
Code: Select all
DebuggerWarning( "Внимание, этот тип данных может существовать только в ядре конструктора!" )
Code: Select all
*x = UTF8("Внимание, этот тип данных может существовать только в ядре конструктора!")
DebuggerWarning(PeekS(*x, -1, #PB_Ascii))
FreeMemory(*x)
Code: Select all
s$ = "Внимание, этот тип данных может существовать только в ядре конструктора!"
*x = AllocateMemory(StringByteLength(s$, #PB_UTF8) + 2)
If *x
PokeS(*x, s$, -1, #PB_UTF8)
DebuggerWarning(PeekS(*x, -1, #PB_Ascii))
FreeMemory(*x)
EndIf
Yes, this helps thanks!AZJIO wrote: Sun Oct 20, 2024 2:06 am I tried to guess which encoding the data is being read in.moreCode: Select all
*x = UTF8("Внимание, этот тип данных может существовать только в ядре конструктора!") DebuggerWarning(PeekS(*x, -1, #PB_Ascii)) FreeMemory(*x)
Code: Select all
s$ = "Внимание, этот тип данных может существовать только в ядре конструктора!" *x = AllocateMemory(StringByteLength(s$, #PB_UTF8) + 2) If *x PokeS(*x, s$, -1, #PB_UTF8) DebuggerWarning(PeekS(*x, -1, #PB_Ascii)) FreeMemory(*x) EndIf
Dancing with a tambourine.. In the case of this idiom, the most understandable translation for a native English speaker will be Shaman's Dance with a Shaman's Drum...
Do some smoke and mirrors
rocket science
I want to do it without all this song and dance