Post Reply 
asc("≤") -> {32,8804,32} ?
07-17-2020, 08:27 AM
Post: #8
RE: asc("≤") -> {32,8804,32} ?
Would it make more sense for the string to character code sequence (and vice versa) functions to deal with unicode character numbers instead of UTF-8 bytes?

Currently:

asc("πi") -> {207, 128, 105} # UTF-8 sequence for U+03C0, U+0069
char({207, 128, 105}) -> "πi"
ord("πi") -> 207 # only the first byte of the UTF-8 sequence for U+03C0
char(207) -> "" # empty string due to partial UTF-8 sequence

('ord' on a non-ASCII character is particularly useless.)

Preferable (IMHO):

asc("πi") -> {960, 105} # UCS sequence U+03C0, U+0069
char({960, 105}) -> "πi"
ord("πi") -> 960 # UCS U+03C0
char(960) -> "π"

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
asc("≤") -> {32,8804,32} ? - compsystems - 07-14-2020, 01:56 AM
RE: asc("≤") -> {32,8804,32} ? - parisse - 07-14-2020, 05:59 PM
RE: asc("≤") -> {32,8804,32} ? - parisse - 07-17-2020, 08:05 PM
RE: asc("≤") -> {32,8804,32} ? - DrD - 07-14-2020, 06:56 PM
RE: asc("≤") -> {32,8804,32} ? - parisse - 07-17-2020, 05:01 AM
RE: asc("≤") -> {32,8804,32} ? - ijabbott - 07-17-2020 08:27 AM
RE: asc("≤") -> {32,8804,32} ? - parisse - 07-17-2020, 08:09 PM



User(s) browsing this thread: 2 Guest(s)