PHP-GTK2 Newsletter

PHP-GTK2 Tips & Techniques
FREE Newsletter
by kksou



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:

How to display non English characters in php gtk2 - Part 6 - Cyrillic characters 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 ;
    ;;;;;;;;;;;;;

    ; Cyrillic characters
    php-gtk.codepage = UTF-8

  6. 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
  1. You can use Cyrillic characters in any standard php-gtk widgets.

Related Links

User reviews   Average user ratings:    5.0   (from 1 user)
  1. XeKtRuM
    July 29, 2008 4:59pm
    Great Thanx

    it just save me a lot of work

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