Special characters problems using Python unicode

前端 未结 4 1224
生来不讨喜
生来不讨喜 2021-01-15 19:54
#!/usr/bin/env python
# -*- coding: utf_8 -*-

def splitParagraphIntoSentences(paragraph):

\'\'\' break a paragraph into sentences
    and return a list \'\'\'
             


        
4条回答
  •  一整个雨季
    2021-01-15 20:16

    That looks like cp437. Try this:

    import codecs, sys
    sys.stdout = codecs.getwriter('UTF-8')(sys.stdout)
    print u"valued at £9.2 billion."
    

    This works for me in Python 2.6.

提交回复
热议问题