Im trying to write a japanese kanji game for a school project, we have to use c. Japanese displays perfectly fine on my personal computer because i set the language to japanese for non unicode programs in my system locale a long time ago. so technically i could write this no problem, but for the purpose of this school assignment i have to set my computer to english system locale just like my schools computer because my teacher will be grading it on a school computer.

Now im encountering the same errors i did on my school's computer, which is i can type in the japanese letters in the printf statement no problem. But when i run it random letters or symbols display instead. How can i make the japanese characters display on all computers? Is there some library i can import in c? I tried to find the answer but only found applications for c#

Im working in visual studios windows 7, my teacher is grading on Dev C.

EDIT: I found this while searching, its a unicode kanji table and it looks like it could work in C..as if its an address to something. its just that im not sure how i would use it. http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml

有帮助吗?

解决方案

This shouldn't be a problem — you don't need to change the locale to Japanese just to display Japanese characters. Just make sure your code is saved with UTF-8 encoding. (The answers to this question may help with that.)

Here's a simple example you can try:

main(){puts("漢字");}

This compiles and runs just fine on my system, where the locale is set to en_GB.UTF-8.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top