Changeset 2804 for pykota/trunk/pykota/storage.py
- Timestamp:
- 03/25/06 22:22:07 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storage.py
r2801 r2804 646 646 def databaseToUserCharset(self, text) : 647 647 """Converts from database format (UTF-8) to user's charset.""" 648 if text is not None : 649 try : 650 return unicode(text, "UTF-8").encode(self.tool.getCharset()) 651 except UnicodeError : 652 try : 653 # Incorrect locale settings ? 654 return unicode(text, "UTF-8").encode("ISO-8859-15") 655 except UnicodeError : 656 pass 657 return text 648 return self.tool.UTF8ToUserCharset(text) 658 649 659 650 def userCharsetToDatabase(self, text) : 660 651 """Converts from user's charset to database format (UTF-8).""" 661 if text is not None : 662 try : 663 return unicode(text, self.tool.getCharset()).encode("UTF-8") 664 except UnicodeError : 665 try : 666 # Incorrect locale settings ? 667 return unicode(text, "ISO-8859-15").encode("UTF-8") 668 except UnicodeError : 669 pass 670 return text 652 return self.tool.userCharsetToUTF8(text) 671 653 672 654 def cleanDates(self, startdate, enddate) :