--- a/VirtualMailManager/__init__.py Fri Jan 22 04:31:38 2010 +0000
+++ b/VirtualMailManager/__init__.py Sun Jan 24 06:40:38 2010 +0000
@@ -38,6 +38,12 @@
_write('\n')
os.sys.exit(code)
+def get_unicode(string):
+ """Converts `string` to `unicode`, if necessary."""
+ if isinstance(string, unicode):
+ return string
+ return unicode(string, ENCODING, 'replace')
+
__all__ = [
# imported modules
'os', 're', 'locale',
@@ -46,6 +52,6 @@
# error codes
'ERR',
# defined stuff
- 'ENCODING', 'w_std', 'w_err'
+ 'ENCODING', 'get_unicode', 'w_std', 'w_err'
]
# EOF