开发者

Bash background color changing for accented character

Basically, I'm using python to print out some information in the terminal and some of the text included accented characters, such as Thai language. When I use try this.

#!/usr/bin/python
#coding: UTF-8
#test.py

import sys

print "\033[41mลองดู\033[0m" #there is an accented character at the end.

Therefore the whole sentence is not background coloured. The terminal omits the last character of the sentence. Is there anyway to fix that? Thanks so 开发者_开发技巧much.


The accent is considered outside of the cell for the purposes of text attributes. Output some spaces before resetting the attributes if you want the accent to appear with the background.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜