Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Not getting spanish characters python

Make sure your using utf-8 encoding

# for reading files
file = open("test.txt", "r", encoding="utf-8")

# for strings
TestText = "Test - āĀēĒčČ..šŠūŪžŽ" # this not UTF-8...it is a Unicode string in Python 3.X.
TestText2 = TestText.encode('utf8') # this is a UTF-8-encoded byte string.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Not #spanish #characters #python
ADD COMMENT
Topic
Name
2+7 =