#3571 closed defect (fixed)
Encoding error in Spanish (at least)
Reported by: | humitos | Owned by: | cjb |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | Unspecified |
Component: | Words | Version: | Unspecified |
Severity: | Unspecified | Keywords: | screenshot, 12.1.0, patch |
Cc: | humitos | Distribution/OS: | Unspecified |
Bug Status: | Unconfirmed |
Description
Steps to reproduce it:
- Open words activity
- Type "habit"
Issue:
The translated words are shown in the Translation Entry, but they are an incorrect encoding. It should be Unicode.
Expected behavior:
Show the translated words in the correct encoding.
Environment:
- jhbuild in Fedora 16
- git version of words-activiy
Attachments (4)
Change History (10)
Changed 12 years ago by humitos
comment:1 Changed 12 years ago by godiard
- Keywords 12.1.0 added
Changed 12 years ago by humitos
comment:2 Changed 12 years ago by humitos
This is the [portion of code http://git.sugarlabs.org/words-activity/words-activity/blobs/master/LanguageModel.py#line29] that opens the files:
with open(filename, 'r') as f: for line in f.readlines(): line = line.rstrip() if line.startswith("#"): continue words_list = line.split('\t') if words_list[0] in self.lang1_lang2: self.lang1_lang2 [ words_list[0].lower() ] += ", " + words_list[-1].lower() else: self.lang1_lang2 [ words_list[0].lower() ] = words_list[-1].lower() if words_list[-1] in self.lang2_lang1: self.lang2_lang1 [ words_list[-1].lower() ] += ", " + words_list[0].lower() else: self.lang2_lang1 [ words_list[-1].lower() ] = words_list[0].lower()
This code doesn't decode the content of the file. So, the encoding used it's the default encoding in the system: utf-8 in Sugar. So, I strongly suggest to convert those (all the .txt) files to UTF-8
Changed 12 years ago by humitos
comment:3 Changed 12 years ago by humitos
- Keywords patch added
comment:4 Changed 12 years ago by humitos
- Resolution set to fixed
- Status changed from new to closed
- from the mailing list:
It introduces some whitespace errors and one typo in 'tachygraphical tquigráfica' but will be fixed on release.
comment:5 Changed 12 years ago by humitos
This will be fixed in version 17.
comment:6 Changed 11 years ago by RafaelOrtiz
Now in V17.
File encoding is not properly set