All the Unicode characters and CHR() [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

All the Unicode characters and CHR() [Resolved]

Post by Kwai chang caine »

Hello at all

I try to write all the UNICODE characters with Chr(), but apparently it's not also easy than that :oops:
I go to Wikipedia page
https://en.wikipedia.org/wiki/List_of_U ... characters
If i want write the "Ƶ", i see a Decimal column with "437" number
U+01B5 Ƶ 437 Latin Capital Letter Z with stroke
So i write

Code: Select all

RenameFile("D:\Nouveau dossier", "D:\" + Chr(437))
and my folder is named now "Ƶ" chr(437) 8)

But if i want use a Cyrillic character for exampler
The table on Wikipedia not have decimal column :|
U+04E8 Ө Cyrillic Capital Letter Barred O 0633
And if i write

Code: Select all

RenameFile("D:\Nouveau dossier", "D:\" + Chr(0633))
My folder is not named "Ө" but "ɹ" :shock:

Is it possible to write all the characters of the world, with only Chr() function and without adding or modify orginal Windows ?

Have a good day
Last edited by Kwai chang caine on Fri May 31, 2024 11:56 am, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: All the Unicode characters and CHR()

Post by idle »

Use the chr function in this module
https://github.com/idle-PB/UTF16
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: All the Unicode characters and CHR()

Post by Kwai chang caine »

Hello IDLE, happy to talk to you

Apprently your module is full functions :shock:
I take a look tomorrow and say to you the result, because in France it's really time to eat and sleep (22h30) :wink:
Thanks a lot and good day for you 8)
ImageThe happiness is a road...
Not a destination
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: All the Unicode characters and CHR()

Post by idle »

sorry, I was on my phone

Code: Select all

Procedure.s StrChr(v.i) ;return a proper surrogate pair for unicode values outside the BMP (Basic Multilingual Plane)
    Protected chr.q
    If v < $10000
      ProcedureReturn Chr(v)
    Else
      chr = (v&$3FF)<<16 | (v-$10000)>>10 | $DC00D800
      ProcedureReturn PeekS(@chr, 2, #PB_Unicode)
    EndIf
  EndProcedur

Tawbie
User
User
Posts: 35
Joined: Fri Jul 10, 2020 2:36 am
Location: Australia

Re: All the Unicode characters and CHR()

Post by Tawbie »

Hello KCC,

You can write 4 Hex digit Unicode code points (characters) using Chr() as long as they are supported by the font you are using.
Easiest to just express the code point (without the U+) in hexadecimal, eg.

Code: Select all

Debug Chr($01B5)
Debug Chr($04E8)

; Debug Output
; Ƶ
; Ө
Last edited by Tawbie on Thu May 30, 2024 12:35 am, edited 1 time in total.
TassyJim
Enthusiast
Enthusiast
Posts: 183
Joined: Sun Jun 16, 2013 6:27 am
Location: Tasmania (Australia)

Re: All the Unicode characters and CHR()

Post by TassyJim »

But if i want use a Cyrillic character for exampler
The table on Wikipedia not have decimal column :|

U+04E8 Ө Cyrillic Capital Letter Barred O 0633

And if i write

RenameFile("D:\Nouveau dossier", "D:\" + Chr(0633))

Plain text
My folder is not named "Ө" but "ɹ" :shock:
04E8 is 1256 decimal

Code: Select all

Debug Chr(1256)
Your font has to have support for the character or you will end up with (usually) a box instead.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: All the Unicode characters and CHR()

Post by Kwai chang caine »

YEEEESSS !!!!

Image

It's a miracle !!!! :shock:

Image

KCC have all understand :mrgreen: 8)

Thanks to you three, i can now, named hundred folders of my hard drive with an "Unique one letter name"
For replace all my tree of files from this normal format
My long name folder 1
. . My long name folder 2
. . . My file 1.txt
. . My long name folder 3
. . . My file 1.txt
. . . My long name folder 4
. . . . My file 1.txt
by this "only one letter name" format
A
. . ᔢ
. . . My file 1.txt
. . ℣
. . . My file 1.txt
. . . ⅁
. . . . My file 1.txt
Because MICROSOFT have not thinking to give the possibility to create a personal ID at each folder :twisted:
With WINDOWS it's impossible to differentiate a folder with another folder, except with his name and path (and his content...who can changed too) :shock:
The only one method, is adding an horrible "desktop.ini" file inside him :|
in my opinion...whoever was responsible for creating the folder function....spent more time in front of the MICROSOFT coffee machine than in front of their PC :lol:

However, it was not complicated to be able to add a simple number to the NTFS structure, which would have allowed us to recognize any folder even if we changed his name or moved it in the tree structure of the hard drive :idea:
It's easy to recognize a file, but a folder...impossible :|

Thanks a lot at you all my friends for your preious help and kindness
Have a very very very good day 8)
ImageThe happiness is a road...
Not a destination
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: All the Unicode characters and CHR() [Resolved]

Post by AZJIO »

C:\Windows\System32\charmap.exe
The program will show which characters are used in the selected font.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: All the Unicode characters and CHR() [Resolved]

Post by Kwai chang caine »

Hello AZJIO :D
Thanks for this tips, i not know it
With it and the previous help of friends i can now better use this UNICODE of misfortune :oops:
Have a good day
ImageThe happiness is a road...
Not a destination
Bitblazer
Enthusiast
Enthusiast
Posts: 761
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: All the Unicode characters and CHR() [Resolved]

Post by Bitblazer »

You may need GNU Unifont
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: All the Unicode characters and CHR() [Resolved]

Post by Kwai chang caine »

Hello Bitblazer :D
Thanks for your link 8)
I have found a BMP font, but i don't know if it's usable with W10 :oops:
ImageThe happiness is a road...
Not a destination
Post Reply