PHP-GTK2 Newsletter

PHP-GTK2 Tips & Techniques
FREE Newsletter
by kksou



Sample Code 173: How to display non English characters in php gtk2 - Part 3 - simplied Chinese on linux?
Written by kksou   
Sunday, 18 February 2007
Problem

You want to display simplified Chinese characters in php-gtk2 on linux as shown below:

How to display non English characters in php gtk2 - Part 3 - simplied Chinese on linux?


Solution
  1. Open php.ini (suppose you have installed php-gtk2 in /usr/local/php, the file php.ini is located in the directory /usr/local/php/lib).
  2. Look for any line with codepage. The default is:
  3. php-gtk.codepage = CP1250

  4. Replace with the following:
  5. ;;;;;;;;;;;;;
    ; Code Page ;
    ;;;;;;;;;;;;;

    ; Chinese simplified
    php-gtk.codepage = CP936

  6. If you have installed standard linux, you should be able to display simplified chinese characters now.

Sample Code
1   
2   
3   
4   
5   
6   
7   
<?php
$window = new GtkWindow();
$window->set_size_request(240, 120);
$window->connect_simple('destroy', array('Gtk','main_quit'));

$label = new GtkLabel("php-gtk2 ÖÐÎÄÏÔʾ"); // note 1

  • Note that this is only 70% of the sample code. You have to be a registered member to see the entire sample code. Please login or register.
  • Registration is free and immediate.
  • Have some doubt about the registration? Please read this forum article.
Explanation
  1. You can use chinese characters in any standard php-gtk widgets.

Related Links

User reviews

There are no user reviews yet.

Note: You have to be a registered member to leave a comment. Free registration here.

 
< Prev   Next >

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2008. kksou.com. All Rights Reserved