Sample Code 176: How to display non English characters in php gtk2 - Part 6 - Cyrillic characters on linux? |
|
Written by kksou
|
|
Monday, 19 February 2007 |
|
Problem You want to display Cyrillic characters in php-gtk2 on linux as shown below:

Solution
- 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).
- Look for any line with codepage. The default is:
php-gtk.codepage = CP1250
- Replace with the following:
;;;;;;;;;;;;;
; Code Page ;
;;;;;;;;;;;;;
; Cyrillic characters
php-gtk.codepage = UTF-8
- If you have installed standard linux, you should be able to display Cyrillic characters 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("§¶§Ö§Ó§â§Ñ§Ý§î 2007"); // 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
- You can use Cyrillic characters in any standard php-gtk widgets.
Related Links
User reviews Average user ratings: 5.0 (from 1 user) Note: You have to be a registered member to leave a comment. Free registration here. |
July 29, 2008 4:59pm
it just save me a lot of work