Page 1 of 1
Scintilla and string in unicode problem
Posted: Mon Jan 23, 2023 1:20 pm
by mag
Do we have a purebasic setting to treat all string as ASCII not unicode?
I have a bit of a problem to exchange data between PB and Scintilla
Re: Scintilla and string in unicode problem
Posted: Mon Jan 23, 2023 1:32 pm
by infratec
No.
Only if you use an old version of PB
But you can always use UTF8() or ASCII() o convert the unicode string from PB.
Re: Scintilla and string in unicode problem
Posted: Mon Jan 23, 2023 2:16 pm
by AZJIO
Switching encoding
Code: Select all
ScintillaSendMessage(#SciGadget, #SCI_SETCODEPAGE, #SC_CHARSET_ANSI)
ScintillaSendMessage(#SciGadget, #SCI_STYLESETCHARACTERSET, 0, #SC_CHARSET_CYRILLIC)
conversion to another encoding
Code: Select all
*Buffer = UTF8(PeekS(*mem, -1, #PB_Ascii))
*Buffer = Ascii(PeekS(*mem, -1, #PB_UTF8))
Import "user32.lib"
; OemToCharBuffA(*Buff,*Buff1,SizeBuff)
CharToOemBuffA(*Buff,*Buff1,SizeBuff)
EndImport
CharToOemBuffA(*Buffer, *Buffer, txtLen)
My_Notepad_Sci
Re: Scintilla and string in unicode problem
Posted: Mon Jan 23, 2023 8:53 pm
by mag
Thank you @infratec and @AZJIO