But anyway, I've suddenly (after all these years!) decided I need Unicode in my life!
In the process of creating a little code, I came across this problem, and work-around.
So I extracted it to the smallest amount of code I could, to demonstrate.
Please note for anyone who may find this post via a search engine, that you must enable the "Create Unicode Executable" in your compiler options in order for this code to work.
Code: Select all
; Note to self: Make sure you set the "Create Unicode Executable" option in the compiler options!
; setup
OpenWindow(1,10,10,400,200,"test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ListViewGadget(1,1,1,WindowWidth(1),WindowHeight(1))
; attempt 1.
AddGadgetItem(1,-1, Chr(1069)) ; display the ascii char "-" not the unicode one.
; attempt 2
txt.s=""
num.l=1069
txt = txt + Chr(num)
AddGadgetItem(1,-1, txt) ; this displays the unicode.
; wait for close window.
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow