View Single Post
Old 07-23-2014, 10:05 AM   #13
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Attached to this is a screen snippet of the output of the following code in my ui.py:

id_map = {}
for book, genre in book_new_genre_final.items():
#print("book, genre : ", book, genre)
mi = Metadata(_('Unknown'))
u_book = book #still in utf8
u_genre = genre #still in utf8
n_book = int(u_book)

if isinstance(u_genre, bytes):
print("u_genre is bytes")
else:
if isinstance(u_genre, unicode):
print("u_genre is utf8")
else:
print("u_genre is something else...")


if n_book > 0 and u_genre > ' ':

All of the output said "u_genre is utf8".

Please look at the screen snippet from metadata.db, which is also attached. Note the complex characters that only unicode can support, such as German umlauts and the Portuguese word.
Attached Thumbnails
Click image for larger version

Name:	Capture_utf8_proof.JPG
Views:	471
Size:	18.7 KB
ID:	125727   Click image for larger version

Name:	utf8_words_in_metadata.JPG
Views:	491
Size:	141.9 KB
ID:	125730  

Last edited by DaltonST; 07-23-2014 at 10:46 AM. Reason: Changed code to show latest version
DaltonST is offline   Reply With Quote