What encoding do I need to display a GBP sign (pound sign) using python on cygwin in Windows XP?

后端 未结 3 951
粉色の甜心
粉色の甜心 2021-01-18 00:31

I have a python (2.5.4) script which I run in cygwin (in a DOS box on Windows XP). I want to include a pound sign (£) in the output. If I do so, I get this error:

         


        
3条回答
  •  终归单人心
    2021-01-18 00:57

    The Unicode for a pound sign is 163 (decimal) or A3 in hex, so the following should work regardless of the encoding of your script, as long as the output encoding is working correctly.

    print u"\xA3"
    

提交回复
热议问题