PHP-GTK2 Newsletter
|
Sample Code 172: How to display non English characters in php gtk2 - Part 2 - traditional Chinese on windows? |
| Written by kksou | ||||||
| Sunday, 18 February 2007 | ||||||
|
Problem You want to display traditional Chinese characters in php-gtk2 on windows as shown below:
Solution
;;;;;;;;;;;;;;;;;;;;;;; PHP-GTK extensions ;;;;;;;;;;;;;;;;;;;;;;;; Extensions written for PHP-GTK are in the format php_gtk_*.dll (Windows) or ;php_gtk_*.so (Unix), written here as a comma-separated list. The library ; files need to be in the same directory as the PHP-GTK library, along with; any other PHP extensions you are using. php-gtk.extensions = php_gtk_libglade2.dll ;;;;;;;;;;;;;; Code Page ;;;;;;;;;;;;;;; The string variables used for titles and other text values in GTK+ are; encoded in UTF-8 internally. A code page is needed so that PHP-GTK 'knows'; which character set is being used, and can convert it to UTF-8 as necessary.; If your environment uses UTF-8 already, you can set the codepage directive ; to UTF-8 to skip the conversions.; The default codepage setting in PHP-GTK 2 is ISO-8859-1, but you can also; use either OEM (e.g. 850) or Windows Code Pages (e.g. CP1250) here, so; long as the encoding format you choose is capable of iconv conversion. See; http://www.microsoft.com/globaldev/reference/cphome.mspx for a list of; the code pages and character sets that are supported on Windows systems.php-gtk.codepage = CP1250
; Local Variables: ; tab-width: 4 ; End:
;;;;;;;;;;;;;
; Code Page ; ;;;;;;;;;;;;; ; Chinese traditional php-gtk.codepage = CP936 ; note: if CP936 doesn't work, try CP950 Sample Code
Explanation
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 > |
|---|






