Changeset 1790 for pykota/trunk/pykota/storage.py
- Timestamp:
- 10/07/04 23:14:28 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storage.py
r1755 r1790 22 22 # 23 23 # $Log$ 24 # Revision 1.63 2004/10/07 21:14:28 jalet 25 # Hopefully final fix for data encoding to and from the database 26 # 24 27 # Revision 1.62 2004/09/28 17:45:31 jalet 25 28 # Added the --hardreset command line option to edpykota … … 685 688 return gpquotas 686 689 690 def databaseToUserCharset(self, text) : 691 """Converts from database format (UTF-8) to user's charset.""" 692 if text is not None : 693 try : 694 return unicode(text, "UTF-8").encode(self.tool.getCharset()) 695 except UnicodeError : 696 pass 697 return text 698 699 def userCharsetToDatabase(self, text) : 700 """Converts from user's charset to database format (UTF-8).""" 701 if text is not None : 702 try : 703 return unicode(text, self.tool.getCharset()).encode("UTF-8") 704 except UnicodeError : 705 pass 706 return text 707 687 708 def openConnection(pykotatool) : 688 709 """Returns a connection handle to the appropriate Quota Storage Database."""