Re: How to represent the letter phi



On 7 Mai, 14:59, "Rudy Velthuis" <newsgro...@xxxxxxxxxxxx> wrote:
Winbug wrote:
Hi
I am going to send the letter phi over a rs232 connection.  The
problem I have is finding the letter in the ascii system.  According
to articles on the web, I can get the letter phi by using either
chr(1000) or chr(618).  

This is not as simple as you think. Note that phi is not part of the
ASCII system at all. It may appear in certain Ansi codepages as one
ofthe charcaters above 127), but it doesn't always. So you'll have to
use one of the forms of Unicode, probably UTF-16 or UTF-8.

Chr(1000) doesn't sound right, since Chr only produces 1-byte
AnsiChars, so the highest value can be 255. So I guess 1000 and 618 are
Unicode code points, and how these are encoded differs on the kind of
encoding you wish. If you use UTF-16, which uses 2 bytes for most
characters, but sometimes pairs of 2-byte characters for the more
unusual ones, you'll havwe to send 2 or 34 bytes over the RS232. If you
use UTF-8, you may have to send even more bytes. I don't know the UTF-8
encoding for phi, but you can find it on the web, I'm sure.

http://unicode.org/faq/utf_bom.html

--
Rudy Velthuis        http://rvelthuis.de

"Eternal nothingness is fine if you happen to be dressed for it."
 -- Woody Allen.

Thanks Guys
I guess I have to go unicode then wich makes it a bit more complicated
since I have to go unicode all the way.

Roger
.



Relevant Pages

  • Re: How to represent the letter phi
    ... I am going to send the letter phi over a rs232 connection. ... problem I have is finding the letter in the ascii system. ... use one of the forms of Unicode, probably UTF-16 or UTF-8. ... characters, but sometimes pairs of 2-byte characters for the more ...
    (comp.lang.pascal.delphi.misc)
  • How to represent the letter phi
    ... I am going to send the letter phi over a rs232 connection. ... problem I have is finding the letter in the ascii system. ... to articles on the web, I can get the letter phi by using either ...
    (comp.lang.pascal.delphi.misc)