ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Re: Encode and emitting the little endian form of UTF-16 (not UTF-16LE)
by Tels other posts by this author
May 23 2007 9:36AM messages near this date
Encode and emitting the little endian form of UTF-16 (not UTF-16LE) | Re: Encode and emitting the little endian form of UTF-16 (not UTF-16LE)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Moin,

On Wednesday 23 May 2007 15:53:14 demerphq wrote:
>  Hi Dan,
> 
>  I was wondering if there is some way to get Encode to emit the little
>  endian version of UTF-16 (with BOM) as a typical Win32 on Intel app
>  would do. It seems to me that currently
> 
>  my $octets= encode('UTF-16',$string);
> 
>  will only emit the big-endian form of it.

As far as I gleaned from working with UTF, this is right. (or in other 
words, UTF-16BE is just an alias for UTF-16), but I could be wrong.

>  Of course well behaved apps shouldnt care, but some do, also i know I
>  can hand emit the BOM myself like so:
> 
>  my $octets= encode('UTF-16LE',chr(0xFEFF).$string);
> 
>  but this strck me as a bit convoluted and makes it a bit tricky to do
>  with IO layers. If there isnt a way to do it currently maybe the name
>  'UTF-16:le' or something similar could be used for this?

I am not sure I understand your question, since you showed it is possible to 
get UTF-16LE, so what exactly do you want more? :)

Shouldn't then:

	binmode ($FILE, 'UTF-16LE') or die("$!");

just work?

All the best,

Tels

- -- 
 Signed on Wed May 23 18:42:25 2007 with key 0x93B84C15.
 Get one of my photo posters: http://bloodgate.com/posters
 PGP key on http://bloodgate.com/tels.asc or per email.

 "I want to squirt you a picture of my kids. You want to squirt me back a
 video of your vacation. That's a software experience."

  -- Steve Baller on the Zune
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iQEVAwUBRlSLcHcLPEOTuEwVAQK1BQf9HvySZaxocPFvAvqXt8IkT/Ylu5FKwk/5
CcG0yaniO/6ONeGsCAxzIDIVEVzyRwOUuet9ninzGNBFIKi10ZXdYew7xRTHVCKs
Bl27qqzq1FFWHAAYwIwRqAgM+GWn2uC2kfHVc0HhWHJieDIUJ8I2Q7HllJJvYoao
exaUMC1PQzwRKKFs7XpaIthgTdad/wepK/6OUtCInSUlWNTCJJbCDl1Bz8ZRFtmp
Hg1wjxJxqbgyvNRFqtoEElqnK9OVfac4Oc+pjNDz/TePt2Ffp/IEKO1YTLW3haLL
PrKNnv+y+jm/CufxVIsbsJk2jqSSv1W7J4TJonViNO8nHe7nNNNiqA==
=Sng/
-----END PGP SIGNATURE-----
Thread:
Demerphq
Tels
Demerphq
Tels
Demerphq
Tels

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved