Re: How to represent the letter phi



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.
.



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. ...
    (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)