Page 1 of 1
How does IDE support unicode?
Posted: Fri Feb 24, 2012 7:34 pm
by skywalk
Code: Select all
Define String.s = "ŠTĚPÁNEK ŻEWŁAKOW"
MessageRequester("", String)
Debug String
; -- USING integrated IDE/Debugger + Unicode ON --
; MessageRequester() ;<-- OK
; Debug ;<-- FAIL = ŠTEPÁNEK ZEWLAKOW
; ŠTĚPÁNEK ŻEWŁAKOW ;<-- OK = Hand Typed into IDE
; -- Using Standalone Debugger GUI + Unicode ON --
; MessageRequester() ;<-- OK
; Debug ;<-- OK = ŠTĚPÁNEK ŻEWŁAKOW
; Standalone code area ;<-- FAIL = Define String.s = "Å TÄšPÃNEK Å»EWÅAKOW"
Apologies to anyone named ŠTĚPÁNEK ŻEWŁAKOW.

Re: How does IDE support unicode?
Posted: Fri Feb 24, 2012 7:37 pm
by ts-soft
The IDE doesn't support Unicode. The Scintilla support UTF-8, if enabled.
Re: How does IDE support unicode?
Posted: Fri Feb 24, 2012 8:30 pm
by Demivec
Freak wrote:To debug unicode programs, simply use the standalone debugger (can be choosen in the preferences).
It will display unicode characters correctly.
Re: How does IDE support unicode?
Posted: Fri Feb 24, 2012 9:20 pm
by skywalk
Yes, I read that the standalone debugger works for unicode, but the code window is wrong as I showed above.
Also, I really prefer the integrated debugger.
Has this been requested?
And is there a technical reason why the debuggers and IDE cannot support unicode?
In my opinion, ascii should NOT be the default option in the compiler options.
Unicode should be the default.
Re: How does IDE support unicode?
Posted: Fri Feb 24, 2012 10:42 pm
by Guimauve
The Editor should be compiled in Unicode,
For you gays work in English it's not a problem, but for me working in French 90% of the time it's painful I need to avoid any French characters in files and folders names.
It's very cheep !
Best regards.
Guimauve
Re: How does IDE support unicode?
Posted: Fri Apr 06, 2012 3:12 am
by RayRayTea
I just tried it with some Chinese characters and it doesn't work at all
For example, a simple
Code: Select all
MessageRequester("PureBasic", "Welcome: 對不起… nothing ")
will show up as:

(The "…" in the text above is the most standard ellipsis (Alt+0133) and even that doesn't show up correctly.)
Also editing non-ANSI text is impossible! Even selecting text makes the characters go wild - try pasting this into the editor
and then position the cursor at the end of the line. Now try selecting the text (Shift + Cursor Left) and watch what happens

or try to erase one of the characters (it will get "transformed" instead)… etc etc
Just to confirm:
How do I enter Unicode characters into the editor?
File menu -> Preferences -> Editor topic -> Use UTF8 encoding.
is enabled, as is "Create Unicode Executable" in the Compiler Options (Unicode compatibility should be turned on by default). My computer has no problems working with Chinese characters in general. Why does PB boast "-Full unicode support"

Re: How does IDE support unicode?
Posted: Fri Apr 06, 2012 3:55 am
by STARGÅTE
I have no problem with this example.
file format: UTF8
compiler: enable unicode
editor font:
unifont.ttf
message requester font: Arial Unicode MS
Re: How does IDE support unicode?
Posted: Fri Apr 06, 2012 8:24 am
by RayRayTea
I double checked, and my settings are almost exactly the same as yours except the fonts - I use Lucida Sans Unicode (changing it to Arial or any other font I tried didn't make any difference btw). Here are my preferences:
http://i40.tinypic.com/2vv3up0.png
http://i40.tinypic.com/fvwjs6.png
http://i40.tinypic.com/34e2ihu.png
Anyway, have you tried editing the text in the editor - does it work for you? On my end, it behaves as if every character were composed of two parts and deleting it just deletes one part of it… You can even click on a character and the cursor will show as if it were behind a character, while it will act as if it were in the middle of it (I guess this all sounds weird).
If it matters, I'm on Windows 7 64 bit (system locale is set to Chinese / traditional) and I'm using (yesterday downloaded) PB 64 bit demo edition.
Re: How does IDE support unicode?
Posted: Mon Jun 04, 2012 5:42 pm
by RayRayTea
And, after a few Windows updates (none of which sounded even remotely connected to the problem at hand) the glitch I kept bumping in magically disappeared: Unicode text editing, comments, strings, it all works! I started feeling adventurous and tried to push it a bit with something like
Code: Select all
For 工作=0 To 20
LineXY(10,10+工作*8,200, 0)
Next
Probably asking a bit too much

"Line 23; Syntax error."
Re: How does IDE support unicode?
Posted: Mon Jun 04, 2012 6:08 pm
by ts-soft
Have you set the FileFormat to UTF8?
Re: How does IDE support unicode?
Posted: Tue Jun 05, 2012 2:07 am
by RayRayTea
Yes, I have.
http://i48.tinypic.com/30v2k5t.png
btw for folks without East Asian font support (older Windows etc), this is what the code above is supposed to look like (you shouldn't see question marks or squares):
http://i46.tinypic.com/3088e42.png