CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
How use UTF8 (persian) in Win32::GUI

 



mohsenalizadeh
Novice

Mar 26, 2010, 4:44 AM

Post #1 of 2 (5152 views)
How use UTF8 (persian) in Win32::GUI Can't Post

I have problem to write with UTF8 chatachters in Win32::GUI.
please help me.
thankyou.


(This post was edited by mohsenalizadeh on Mar 26, 2010, 8:12 AM)


mohsenalizadeh
Novice

Apr 4, 2010, 9:02 AM

Post #2 of 2 (5074 views)
Re: [mohsenalizadeh] How use UTF8 (persian) in Win32::GUI [In reply to] Can't Post

I use this methods :


Code
sub t2w { 
my ($text) = @_;
return encode("UTF-16LE", $text . "\x00");
}

our $SetWindowTextW_fn = undef;
sub text {
my ($control, $text) = @_;
if (not $SetWindowTextW_fn) {
$SetWindowTextW_fn = Win32::API->new("user32", "SetWindowTextW",
"NP", "N");
die unless $SetWindowTextW_fn;
}
$SetWindowTextW_fn->Call($control->{-handle}, t2w($text));
}

and use :

Code
text($owner,$title);


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives