On Wed, 27 Mar 2002, Tatsuhiko Miyagawa wrote:

> use DBI;
>
> my $dbname = "t/db.$$";
> my $orig = "\xa4\xa2"; # japanese "A" in EUC-JP
....
> insert_string($dbh, $orig);

Ah this is much clearer now. SQLite expects and requires utf-8 characters
as input (it can't cope with binary data - it is purely a text based
database). Sorry, but that's just the way it goes.

Try using actual UTF-8 characters there (i.e. chr(12354) in this
particular case if my conversion is correct).

The way to get this working with perl 5.6.1 while still using native
japanese characters is to use something like Text::Iconv to do the
conversion:

my $converter = Text::Iconv->new("EUC-JP", "UTF-8");
my $input = pack("U0A*", $converter->convert($jap_string));

(the pack turns on the UTF8 bit)

I'll try and add something to the docs.

-- 
<!-- Matt -->
<:->Get a smart net</:->

Reply via email to