My problem is not unicode, it is the fact the Form Designer saves in ASCII by default and that messes up UTF8 projects.
Most users don't see this bug, because it is only visible when using Latin or an encoding other then ascii.
Example for dummies:
I created this simple GUI and saved normally (IDE file format confirmed has: Utf8)
Code: Select all
;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;
Enumeration FormWindow
#Window_0
EndEnumeration
Enumeration FormGadget
#Button_0
#Button_1
#Button_2
#Text_0
#Text_1
#Text_2
EndEnumeration
Procedure OpenWindow_0(x = 0, y = 0, width = 365, height = 105)
OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu)
ButtonGadget(#Button_0, 230, 15, 100, 25, "aáàâä")
ButtonGadget(#Button_1, 125, 15, 100, 25, "oóòõö")
ButtonGadget(#Button_2, 15, 15, 100, 25, "aáàâä")
TextGadget(#Text_0, 20, 50, 100, 25, "oóòõö")
TextGadget(#Text_1, 235, 50, 100, 25, "aáàâä")
TextGadget(#Text_2, 125, 50, 100, 25, "aáàâä")
EndProcedure
I open this fresh file in notepad++ and it is ASCII, not UTF8 has it should be!
Now, i go to the IDE, change the form to code view and check File Format -> Encoding: ASCII and back to Encoding: UTF8, this is the result:
Code: Select all
Enumeration FormWindow
#Window_0
EndEnumeration
Enumeration FormGadget
#Button_0
#Button_1
#Button_2
#Text_0
#Text_1
#Text_2
EndEnumeration
Procedure OpenWindow_0(x = 0, y = 0, width = 365, height = 105)
OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu)
ButtonGadget(#Button_0, 230, 15, 100, 25, "aÀ¡À À¢À¤")
ButtonGadget(#Button_1, 125, 15, 100, 25, "oÀ³À²ÀµÀ¶")
ButtonGadget(#Button_2, 15, 15, 100, 25, "aÀ¡À À¢À¤")
TextGadget(#Text_0, 20, 50, 100, 25, "oÀ³À²ÀµÀ¶")
TextGadget(#Text_1, 235, 50, 100, 25, "aÀ¡À À¢À¤")
TextGadget(#Text_2, 125, 50, 100, 25, "aÀ¡À À¢À¤")
EndProcedure
Now the file is saved has UTF8 (has it should have been since start), but the gadget descriptions encoding are all *** up ...
And the problem is this happens automatically if i have the misfortune of opening the pbf file by mistake...