Changeset 114
- Timestamp:
- 03/22/04 17:22:05 (4 years ago)
- Files:
-
- 05/devel/kombilo.py (modified) (2 diffs)
- 05/devel/v.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
05/devel/kombilo.py
r111 r114 908 908 if encoding: 909 909 try: 910 t = t.decode(encoding ).encode('utf-8')911 except ImportError:910 t = t.decode(encoding, 'ignore').encode('utf-8', 'ignore') 911 except: 912 912 pass 913 913 … … 2707 2707 if currentEncoding != 'utf-8': 2708 2708 try: 2709 s = sOrig.decode(currentEncoding ).encode('utf-8')2709 s = sOrig.decode(currentEncoding, 'ignore').encode('utf-8', 'ignore') 2710 2710 cursor = Cursor(s, self.options.sloppySGF.get()) 2711 2711 05/devel/v.py
r106 r114 1055 1055 if self.encoding: 1056 1056 try: 1057 s = s.decode(self.encoding.lower() ).encode('utf-8')1057 s = s.decode(self.encoding.lower(), 'ignore').encode('utf-8', 'ignore') 1058 1058 except: 1059 1059 pass … … 2233 2233 2234 2234 2235 def openFile(self, path = None, filename = None, encoding = None):2235 def openFile(self, path = None, filename = None, encoding = ''): 2236 2236 """ Read an SGF file given by filename (if None, ask 2237 2237 for a filename). """ … … 2615 2615 for k in self.gameinfoDict.keys(): 2616 2616 try: 2617 self.gameinfoDict[k] = [ x.encode(self.gameinfoDictencoding )\2617 self.gameinfoDict[k] = [ x.encode(self.gameinfoDictencoding, 'ignore')\ 2618 2618 for x in self.gameinfoDict[k] ] 2619 2619 except: … … 2629 2629 for k in self.gameinfoDict.keys(): 2630 2630 try: 2631 self.gameinfoDict[k] = [ x.encode(self.gameinfoDictencoding )\2631 self.gameinfoDict[k] = [ x.encode(self.gameinfoDictencoding, 'ignore')\ 2632 2632 for x in self.gameinfoDict[k] ] 2633 2633 except: … … 2636 2636 2637 2637 2638 def gameinfo(self, data=None, encoding= None):2638 def gameinfo(self, data=None, encoding=''): 2639 2639 """ Open window with the game info of the current game.""" 2640 2640 2641 if encoding is None: encoding = self.cursor.encoding 2641 if encoding == '': encoding = self.cursor.encoding 2642 # FIXME: sollte dies nicht sein: if self.cursor.encoding: encoding = self.cursor.encoding ? 2643 2642 2644 if not data and not self.cursor: 2643 2645 return … … 2663 2665 for k in self.gameinfoDict.keys(): 2664 2666 try: 2665 self.gameinfoDict[k] = [x.decode(encoding ) for x in self.gameinfoDict[k]]2667 self.gameinfoDict[k] = [x.decode(encoding, 'ignore') for x in self.gameinfoDict[k]] 2666 2668 except: 2667 2669 pass
