Re: utf8 bug ?
- From: Ross McFarland <rwmcfa1 neces com>
- To: Quentin <squentin free fr>
- Cc: Gtk-Perl-List <gtk-perl-list gnome org>
- Subject: Re: utf8 bug ?
- Date: Thu, 02 Sep 2004 22:55:22 -0400
On Thu, 2004-09-02 at 17:19, Quentin wrote:
Hi,
Setting a label (or something else, works with a treestore) with a perl
variable, change the encoding of the perl variable to utf8.
use Gtk2 '-init';
my $string='a string';
warn '$string is '.(utf8::is_utf8($string)? '':'not ')."utf8";
my $label=Gtk2::Label->new($string);
warn '$string is '.(utf8::is_utf8($string)? '':'not ')."utf8";
this sample code outputs :
$string is not utf8 at utf8.pl line 3.
$string is utf8 at utf8.pl line 5.
the code causing this is in Glib typemap:
INPUT:
T_GCHAR
/* same as SvGChar(), but not in a function */
sv_utf8_upgrade ($arg);
$var = ($type)SvPV_nolen ($arg);
the sv_utf8_upgrade is the culprit. i'm not sure whether or not to call
this a bug though.
--
-rm
http://www.neces.com/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]