문제

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