PHP-GTK2 Newsletter
|
Sample Code 171: How to display non English characters in php gtk2 - Part 1 - simplied Chinese on windows? |
| Written by kksou | ||||||
| Sunday, 18 February 2007 | ||||||
|
Problem You want to display simplified 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 simplified php-gtk.codepage = CP936 Sample Code
Explanation
Related Links
User reviews Average user ratings: 0.0 (from 4 users) Note: You have to be a registered member to leave a comment. Free registration here. |
||||||
| < Prev | Next > |
|---|







0.0 (from 4 users)
February 20, 2007 4:59am
How do you save your scripts as when ever i try it kills the caticters and if i save a unicode text document php wont run it
February 20, 2007 9:02am
If you have problem saving the above script, then just replace the chinese text above with any other chinese text.
If you still have problem, please give a bit more details. E.g. what windows are you running? English windows? Simplified Chinese windows? Any error message displayed when you run the script?
June 04, 2007 12:18pm
if i want to print hello world in chinese format what we have to do .plz explian neately with code that i can understand
June 15, 2007 6:38pm
Which of the above steps do you find confusing? Which step did not work? What did you see on the screen? What's the error message. Please be more specific so that I know which part I need to elaborate on.