Ahmet has asked for the wisdom of the Perl Monks concerning the following question:

Hi perlmonks,

Perl : (v5.12.2) MSWin32-x86 build 1203 294165,

OS : Windows 7 x86,

Installed languages in OS : English,Turkish

How to display the unicode charset in Win32::GUI Label->Text?

I'm working on a project and i added the multilanguage support.

Example; added "russian language" but not display in label text.

I'm searching for solutions 3 days.

I'm founded this solutions (and other)

http://webcache.googleusercontent.com/search?q=cache:5HoSSFnETV4J:www.mail-archive.com/perl-win32-gui-users%40lists.sourceforge.net/msg04941.html+perl+win32+GUI+unicode+label&cd=5&hl=tr&ct=clnk&gl=tr&source=www.google.com.tr http://webcache.googleusercontent.com/search?q=cache:l_gAFrhiqxMJ:www.mail-archive.com/perl-win32-gui-users%40lists.sourceforge.net/msg04944.html+perl+win32+GUI+unicode+label&cd=6&hl=tr&ct=clnk&gl=tr&source=www.google.com.tr
[My idea]
I have install the russian language in my OS?
This is a solution?

Replies are listed 'Best First'.
Re: How to display unicode charset in Win32::GUI?
by ikegami (Patriarch) on Feb 16, 2011 at 17:20 UTC
    Could you provide a minimal code sample that demonstrates the problem, please? I might spot something obvious and/or try a few things, but I'm not going to start from scratch.
Re: How to display unicode charset in Win32::GUI?
by moritz (Cardinal) on Feb 16, 2011 at 16:42 UTC
Re: How to display unicode charset in Win32::GUI?
by vkon (Curate) on Feb 16, 2011 at 22:39 UTC
    I guess, you need to encode to ucs2 encoding, using "Encode" module

    And - PLEASE - remove <code> tags, use <a> tags for your long URLs - your URLs messes PM layout

      Thank you very much all.

      @moritz : I tried hard to Encode qw/encode decode/ module but didn't.

      Here is my codes.

      Reminder:

      Installed language packets in my OS : English, Turkish

      Turkish charset testing : ç
      use warnings; use strict; use Win32::GUI(); use Data::Dumper; use Encode qw/decode/; my $str = "ç"; # This is "turkish" charset "ç" $str = decode("utf-8", $str); # decoding "ç" char with utf-8 print Dumper($str); # And "ç" char dumped, output : \x{e7} my $win = new Win32::GUI::Window( -name => "win", -text => "Unicode Test", -width => 300, -height => 200 ); $win->AddLabel( -name => "labeun", -text => "\x{e7}", # <--- Write here hex code char "\x{e7}" # and look at the results. Displaying label text "ç +". No problem. -width => 50, -height => 20 ); $win->Center(); $win->Show(); Win32::GUI::Dialog(); 1;

      I tried ucs2 encoding but didn't and.
      Example : Russian charset ф
      $rchar = ф
      use warnings; use strict; use Win32::GUI(); use Encode qw/encode decode/; use Data::Dumper; my $str = "$rchar"; # This is "russian" charset. * a == $rchar * my $utf8 = decode("utf-8", $str); # decoding "$rchar" char with utf-8 my $ucs2 = encode("UCS-2LE",$utf8); # and encoding char with UCS-2LE.Others have tried.! # Other encoding schemes : UCS-2BE, UCS-2LE, UTF-16, # UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE my $win = new Win32::GUI::Window( -name => "win", -text => "Unicode Test", -width => 300, -height => 200 ); $win->AddLabel( -name => "labeun", -text => "$ucs2", # <--- Writing here encoding char.Displaying label t +ext "unkown". FAIL -width => 50, -height => 20 ); $win->Center(); $win->Show(); Win32::GUI::Dialog(); 1;

      [idea]

      My OS needed the Russian language package?
        well,
        after looking closer into that module - I realized that it is indeed insensitive to unicode,
        and this is not what we're expecting nowadays.

        Maybe you just need to apply for developers and supporters?

        SUPPORT Homepage: http://sourceforge.net/projects/perl-win32-gui/ For further support join the users mailing list(perl-win32-gui-users@lists.sourceforge.net) from the website +at http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users. There is a searchable list archive at http://sourceforge.net/mail/?group_id=16572
        And better yet - switch to Tcl/Tk GUI - it allows unicode reasonably well.