Douglas Wilson wrote:

> > $string =~ s/(.)/$1\x00/g;    # expand ANSI to UTF-8 (not the most
> 
> Slightly more efficient (~30% ?), but more to type, is:
> 
> $string = pack("Ax" x length $string, split("", $string));

These are the fastest I've seen so far:

sub tounicode { my $s = shift; pack('v*', unpack('c*', $s)) }

sub fromunicode { my $s = shift; pack('c*', unpack('v*', $s)) }

Anyone got anything faster?

-- 
Ned Konz
currently: Stanwood, WA
email:     [EMAIL PROTECTED]
homepage:  http://www.bike-nomad.com

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to