Tuesday, June 13, 2017

Japanese Characters & Strings in Python

hiragana
for i in range(0x3040, 0x30a0): print(chr(i), end='')
katakana
for i in range(0x30a0, 0x3100): print(chr(i), end='')
kanji
for i in range(0x4e00, 0x4f00): print(chr(i), end='')
morpho!

import sys
import codecs
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
sys.stderr = codecs.getwriter('utf8')(sys.stderr)
export PYTHONIOENCODING=UTF-8

No comments:

Post a Comment

Going one step further with Kotlin & gRPC

Recently, I tried using Quarkus with Kotlin for grpc. I have worked with grpc for communication between microservices in Java & Golang. ...