Let me tell you here about the principle of displaying Chinese in GD. I believe you can write one down after reading it.
The GD library in PHP actually supports Chinese, but it must be passed in UTF-8 format parameters. You can try the following applet.
You will be able to see a graphic with the words "Chinese OK" displayed. (
UTF-8: Unicode Transfer Format 8 is a compatible representation of Unicode)
Header("Content-type: image/gif") ;
$im = imagecreate(400,300);
$bkg = ImageColorAllocate($im, 0,0,0);
$clr = ImageColorAllocate($im, 255,255,255);
$fnt = "c:/winnt/fonts/simhei.ttf";
// if 98/95 "c:/windows/fonts/simhei.ttf";
$str = chr(0xE4).chr(0xB8) .chr(0xAD).chr(0xE6).chr(0x96).chr(0x87)."OK";
// "Chinese OK" in UTF-8ImageTTFText($im, 20, 0, 10, 20, $clr, $fnt, $str);
ImageGif($im);
ImageDestroy($im);?>
If you just want to display a fixed Chinese string, you can use Word, Four Use Tongcube and other software to convert the characters to be displayed into UTF-8 format, and then paste them into the program. If you want to dynamically display corresponding Chinese characters based on user input, then you must solve the problem of converting the internal code of Chinese characters into UTF-8 format.
I am not very clear about Chinese processing under UNIX/Linux and have no say. If it uses Unicode internal code, Unicode should be converted into UTF-8 format.
If GBK internal code is used like Win95/98, it should be converted to Unicode first and then to UTF-8 format.