Telling perl to expect input data to be in UTF8

G

Graham Wood

Hi all,

I've got this friend who's using perl 5.6.1 and DBI to import data that is in UTF8 and he is unable to display the data successfully after it imports from the database.  I read in perldoc perlunicode shipped with 5.6.1 that you can't tell perl to expect UTF8 data from an external file or source but that it would shortly be addressed in a future version.  Can anyone tell me if this has happened yet, and if so, in which version of perl it is available?

Thanks

Graham
 
D

David K. Wall

Graham Wood said:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi all,
<p>I've got this friend who's using perl 5.6.1 and DBI to import
data that
is in UTF8 and he is unable to display the data successfully after
it imports from the database.&nbsp; I read in perldoc perlunicode
shipped with 5.6.1 that you can't tell perl to expect UTF8 data
from an external file or source but that it would shortly be
addressed in a future version.&nbsp; Can anyone tell me if this
has happened yet, and if so, in which version of perl it is
available?
<p>Thanks
<p>Graham</html>
[snip vcard crap]

I don't know the answer to your question, but I do know that by
posting in HTML you made your post invisible to at least some of the
people most likely to be able to answer your question. (They have
their newsreaders configured to basically ignore posts that aren't
plain text.) The ones that did notice it probably took one look at
the HTML and went to the next article.

Hint, hint. :)
 
G

Graham Wood

Hi all,

I've got this friend who's using perl 5.6.1 and DBI to import data that
is in UTF8 and he is unable to display the data successfully
after it imports from the database. I read in perldoc perlunicode
shipped with 5.6.1 that you can't tell perl to expect UTF8 data
from an external file or source but that it would shortly be addressed
in a future version. Can anyone tell me if this has happened
yet, and if so, in which version of perl it is available?

Thanks

Graham
 
G

Graham Wood

Graham said:
Hi all,

I've got this friend who's using perl 5.6.1 and DBI to import data that
is in UTF8 and he is unable to display the data successfully
after it imports from the database. I read in perldoc perlunicode
shipped with 5.6.1 that you can't tell perl to expect UTF8 data
from an external file or source but that it would shortly be addressed
in a future version. Can anyone tell me if this has happened
yet, and if so, in which version of perl it is available?

Thanks

Graham

Humble apologies to all who have killfiled me for HTML crimes in the
plain text newsgroup. I foolishly thought when I asked Netscape to send
in plain text only that's what it would do. I have now scraped all
traces of html from my messages.

Graham
 
A

Alan J. Flavell

Graham Wood <[email protected]> wrote in a format that's
automatically suppressed by my news filters:

That's true enough. 5.6.1 has some of the machinery for utf8 support,
but you need 5.8.0 (or later) to get the features integrated into
I/O calls such as open() and binmode()

perldoc perlunicode has the gory detail; perldoc perluniintro is a
useful introduction. Both can be found at
http://www.perldoc.com/perl5.8.0/pod.html if you don't have your own
5.8.0 installation yet. Well, sure, they can still be found there
even if you do - but you would also have them nearer at hand.

Works well, as far as I could make out, except for dealing with
Windows-flavoured newlines, which basically had me at a loss (see
earlier discussion of utf-16 formats on Windoze).

good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top