Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
oyster wrote: look at the attached pic( sorry, it is a big one).
Okay, let me see if I have this straight, so I can figure out where we stand as of now:
When saving as utf-8, the default font selection code does not work if you give it Chinese characters for the font name. It does work if you give it ascii font filenames, like "simsun.ttf".
The characters that are displayed on the screen are correct when saved as UTF-8, assuming that the font is correctly selected. (This is the part that's confusing to me... your example shows 3 characters before the comma in the "right one" example, but only 2 in the corresponding picture. The characters also look very different, at least to my eyes, which are not familiar at all with hanzi characters Is the correct text being displayed?)
PyTom wrote:When saving as utf-8, the default font selection code does not work if you give it Chinese characters for the font name. It does work if you give it ascii font filenames, like "simsun.ttf".
yes
PyTom wrote:
The characters that are displayed on the screen are correct when saved as UTF-8, assuming that the font is correctly selected.
yes, again.
PyTom wrote:
(This is the part that's confusing to me... your example shows 3 characters before the comma in the "right one" example, but only 2 in the corresponding picture. The characters also look very different, at least to my eyes, which are not familiar at all with hanzi characters Is the correct text being displayed?)
(This is the part that's confusing to me... your example shows 3 characters before the comma in the "right one" example, but only 2 in the corresponding picture. The characters also look very different, at least to my eyes, which are not familiar at all with hanzi characters Is the correct text being displayed?)
In a ansi text file, one Chinese Characters needs 2 chars. But for a utf_8 text file, I donno. I think it should be 4 chars, but it is (perhaps) 1.5( my god! ) chars when saved in SciTE.
oyster wrote:e, one Chinese Characters needs 2 chars. But for a utf_8 text file, I donno. I think it should be 4 chars, but it is (perhaps) 1.5( my god! ) chars when saved in SciTE.
utf-8 takes 3 bytes to encode most 2-byte characters. So you're seeing 6 bytes which your mbcs is rendering as 3 characters.