How does IDE support unicode?

Working on new editor enhancements?
User avatar
skywalk
Addict
Addict
Posts: 4003
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

How does IDE support unicode?

Post 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. :wink:
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: How does IDE support unicode?

Post by ts-soft »

The IDE doesn't support Unicode. The Scintilla support UTF-8, if enabled.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Demivec
Addict
Addict
Posts: 4091
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: How does IDE support unicode?

Post 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.
User avatar
skywalk
Addict
Addict
Posts: 4003
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: How does IDE support unicode?

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: How does IDE support unicode?

Post 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
RayRayTea
New User
New User
Posts: 8
Joined: Thu Apr 05, 2012 5:59 pm

Re: How does IDE support unicode?

Post 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:
Image
(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

Code: Select all

;對不起
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" :(
User avatar
STARGÅTE
Addict
Addict
Posts: 2090
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: How does IDE support unicode?

Post by STARGÅTE »

I have no problem with this example.
Image

file format: UTF8
compiler: enable unicode
editor font: unifont.ttf
message requester font: Arial Unicode MS
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
RayRayTea
New User
New User
Posts: 8
Joined: Thu Apr 05, 2012 5:59 pm

Re: How does IDE support unicode?

Post 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.
RayRayTea
New User
New User
Posts: 8
Joined: Thu Apr 05, 2012 5:59 pm

Re: How does IDE support unicode?

Post 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."
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: How does IDE support unicode?

Post by ts-soft »

Have you set the FileFormat to UTF8?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
RayRayTea
New User
New User
Posts: 8
Joined: Thu Apr 05, 2012 5:59 pm

Re: How does IDE support unicode?

Post 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
Post Reply