730 | | def databaseToUserCharset(self, text) : |
731 | | """Converts from database format (UTF-8) to user's charset.""" |
732 | | return self.tool.UTF8ToUserCharset(text) |
733 | | |
734 | | def userCharsetToDatabase(self, text) : |
735 | | """Converts from user's charset to database format (UTF-8).""" |
736 | | return self.tool.userCharsetToUTF8(text) |
737 | | |
| 730 | def databaseToUnicode(self, text) : |
| 731 | """Converts from database format (UTF-8) to unicode.""" |
| 732 | if text is not None : |
| 733 | return text.decode("UTF-8", "replace") |
| 734 | else : |
| 735 | return None |
| 736 | |
| 737 | def unicodeToDatabase(self, text) : |
| 738 | """Converts from unicode to database format (UTF-8).""" |
| 739 | if text is not None : |
| 740 | return text.encode("UTF-8", "replace") |
| 741 | else : |
| 742 | return None |
| 743 | |