[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] bug in MIME::QuotedPrint ?



At 15.18 +0100 2000.02.02, Axel Rose wrote:

>>>MacPerl's ord() function is not portable with 8bit characters.
>>>I have no idea whether this is known nor do I have a workaround yet.
>>
>>Nonsense.  MacPerl's ord() function is doing exactly what you've told it
>>to do.  It has no idea how a certain byte appears on your screen. Nor
>>*can* it know, since on a Mac you can so easily change fonts.
>
>I disagree. ord() gives different results on different platforms.
>I claimed portability.

Actually, no, it gives the exact same results on every platform.  It may be
rendered in your fonts differently on different platforms.  It may be
rendered in your fonts differently on the SAME platform.

Window 1 (ProFont):

  print ord 'u';  # this is option-shift-u, u (u with umlaut)

Returns:

  159

Window 2 (ProFontISOLatin1):

  print ord 'u';  # this is option-shift-z (u with umlaut)

Returns:

  252

In both cases, we have a u with an umlaut.  In both cases, we are in
MacPerl.  Yet to get u with umlaut, we had to use different key sequences,
which produce different bytes, which ord gives different answers for.

ord() does not return a number depending on what physical character you are
using.  It returns a number based on what the internal representation of
that character is.  It is very portable; the problem is, your fonts are not.

>I would like to know how to do this an 8.x systems.
>PostScript fonts may have their own encoding vector, true. But this
>has effect in printing only. A keyboard input will produce the
>same code everytime.

Nope.  Depends on the font.  (option-shift-u, u) will always produce the
same byte on a Mac, which may be represented differently by different fonts.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org