RE: how to make a program/macro that toggles ascii/unicode characters

Date: Tue May 30 2000 - 12:35:52 EDT

Michael Kaplan wrote:
> Actually, this is not 100% true.
> ChrB returns a single byte. Chr returns a single Unicode
> character from a code point using the default system codepage
> to intepret the code point. WhrW returns a single Unicode
> character from a Unicode code point.
> Chr is not a wrapper, it performs a different functionality.
> Try the following from the debug window:
> ? Len(ChrB(65) & ChrB(65)), Len(Chr(65) & Chr(65)),
> Len(ChrW(65) & ChrW(65))

My error. I apologize for having oversimplified.

There is a even better demonstration of Michael's statement: passing the
Euro sign (in Window's pseudo-Latin-1) to the 3 Asc...() functions:

   ? Hex(Asc("€")), Hex(AscW("€")), Hex(AscB("€"))

This prints 3 different results:

   80 20AC AC

That is: the Euro symbol in pseudo-Latin-1; the Euro symbol in Unicode; the
first byte (little-endianly) of the Euro symbol in Unicode.

_ Marco

This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:03 EDT