develooper Front page | perl.perl5.porters | Postings from September 2000

Re: unicode support and perl

Thread Previous | Thread Next
From:
Marc Lehmann
Date:
September 15, 2000 08:52
Subject:
Re: unicode support and perl
Message ID:
20000915175232.K1232@cerebro.laendle
On Fri, Sep 15, 2000 at 04:38:45PM +0100, Nicholas Clark <nick@ccl4.org> wrote:
> is hidden from the user (nearly all the time except in cases like syscall())
> it might be sensible to have an interface like SvIOK, SvPOK such that
> "binary" and "string" were two distinct (convertible) types which might
> happen to be implemented inside the SV * as a buffer pointer and a flag?

AFAICS this is *exactly* how it is currently implemented. Please also note
that the internal representation of scalars is quite an important issue
for users ("0 but true"? use integer?).

The single important difference is that you cannot tell utf8 strings from
normal strings (in general), and that only the user ultimately knows which
datatype the scalar has.

> And that C and XS code uses one or other set of macros depending on whether
> it wants binary (octet) data, or string data?

It's not that easy. There are two differnt types of strings as well, and
converting between them cannot be automatic. Maybe I was too drastic when
proposing "binary" and "string" datatypes. What I meant to say was that
perl cannot tell binary/string from each other (because it is a policy
decision by the user) and thus the internal representation of "PV" scalars
must be known.

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       pcg@opengroup.org |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About