hkscs unicode converter
v1.1.0
HKSCS-Unicode-Converter是將分配給Unicode的私有使用區域的HKSCS字符在Unicode 4.1中轉換為等效物的實用程序。受同名NPM模塊的啟發。
> >> from hkscs_unicode_converter import converter
> >> converter . convert_string ( "亂廿四" ) # Convert an entire string
'亂噏廿四'
> >> converter . convert_char ( "" ) # Convert a single character
'嘅'
> >> converter . convert_char ( chr ( 0xE7D4 )) # Convert from codepoint
'啱'
> >> converter . convert_char ( " uE7D4 " ) # Convert from Unicode literal
'啱'
> >> hex ( ord ( converter . convert_char ( chr ( 0xE7D4 )))) # Get corresponding codepoint
'0x5571' HKSCS-Unicode-Converter可在PYPI上獲得,並正式支持Python 3.7+:
$ python3 -m pip install hkscs-unicode-converter 測試位於HKSCS_UNICODE_CONVERTER子模塊中。測試使用TOX來自動化環境管理和內置的Unittest框架以運行測試。
$ tox 在承諾掌握之前跑黑色!