Search
 
SCRIPT & CODE EXAMPLE
 

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.
Comment

PREVIOUS NEXT
Code Example
Python :: gluten 
Python :: runner up score hackerrank 
Python :: olst = [] a = int(input()) b = int(input()) for ele in range(a,b+1): if ele%2 != 0: olst.append(ele) print(olst[::-1]) 
Python :: how to say someting in python 
Python :: Liczby zespolone Python 
Python :: keras ensure equal class representation during traingin 
Python :: function python to get the minimu and its position 
Python :: django check if url safe 
Python :: cut 0s on string python 
Python :: python join list with comma 
Python :: how to loop through files in a directory python 
Python :: how to get hostname from ip python 
Python :: program to segregate positive and negative numbers in same list 
Python :: reverse pd based on index 
Python :: most occurring string in column pandas 
Python :: import math print(math.log(1024,2)) 
Python :: auto create requirements.txt 
Python :: python hash string 
Python :: python sort list in reverse order 
Python :: number of rows or columns in numpy ndarray python 
Python :: render_template not showing images 
Python :: how to access a private attribute in child class python 
Python :: python get ip info 
Python :: django rest framework delete file 
Python :: pd.merge left join 
Python :: put array over array in numpy 
Python :: how to convert a dense matrix into sparse matrix in python 
Python :: factors addition in pyhone 
Python :: check if env variable exists python 
Python :: show image with ratio opencv python 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =