+ 1

Print Japanese

Can I print Japanese characters on Python using print()? If so how can I print them? I tried using the unicodes of the characters but it didn’t work. For example, I tried using print(‘\u3041’) to print ぁ, but it didn’t work, it gave Error.

30th Apr 2018, 11:57 PM
Duc Van Khanh Tran
Duc Van Khanh Tran - avatar
2 Respostas
+ 6
Perhaps what you use to view the output makes a difference? Are we sure that all interpreters/IDEs are capable of outputting Japanese characters?
1st May 2018, 2:29 AM
Fox
Fox - avatar
+ 2
Did you attempt using the "\u[4 digit hexadecimal]" notation? If you’re not and you’re using "\U", well. I’m not sure, as I use \u always. (I mean that literally.) If the characters for example, if you want to print the character "ぁ" (I cannot read Japanese, so if that is offensive, I am very, VERY sorry), you would type "print('\u3041')" (minus the double quotes, obviously.)
1st May 2018, 1:01 AM
Astutewinter
Astutewinter - avatar