[Kde-perl] Perlqt unicode(utf-8) problems

Michael Traxler kde-perl@mail.kde.org
Sat, 21 Dec 2002 15:24:59 +0100 (MET)


Hi!

Is there a possibility to switch off the new unicode-way of handling strings
in PerlQt?
The problem is, that I want to upgrade to the new PerlQt3.0004, but I
realized that it is not backward compatible.
If the whole world was using unicde, then this would not be a problem, but
my application is connected to mysql, which doesn't know unicode.
So, this would mean to me, that I have to go through all my application and
convert all sql-commands sent to DBI with
$sql = pack("C*", unpack("U*", $sqp));
Ok, this would work, but is unconveniant and error-prone because I also have
to test all other "world"-interactions, if they are handled correctly.

Is there a switch to turn off the utf-8 encoding in Qt-strings?

Perl itself is quite consistent in its behaviour:
As my environment LANG is not UTF-8
michaelt@linux:~> env| grep LANG
LANG=de_DE@euro

the following output will first be converted to latin-1 before sent to the
output:
perl -e '$a="a\x{e4}\n"; print $a'   (output is just 3 bytes long)

where as
perl -e 'binmode(STDOUT, ":utf8"); $a="a\x{e4}\n"; print $a'  writes out 4
bytes utf-8.

I realize that there is a problem, as internal usage of unicode is perfect,
but the idea of unicode is, that it should be transparent to the user, which
is not the case when I interact with non-unicode applications. Therefore, I
would like an option to neglect the whole unicode business...


Thanks a lot,

	Michael


------------------------------------------------------------------------------
Whenever you dream you're holding the key it opens the door to let you be free
RJD

-------------------------------------
I have not failed.  I have just
found 10,000 ways that don't work.
        - Thomas Edison
-------------------------------------