root/trunk/lib/enc.py

Revision 15, 1.1 kB (checked in by mjoc, 1 year ago)

Atnaujinti vertimai. Pridėti nauji copyright'ai. Pakeista konfigūracija.

Line 
1 #
2 # OpenDict
3 # Copyright (c) 2003-2006 Martynas Jocius <martynas.jocius@idiles.com>
4 # Copyright (c) 2007 IDILES SYSTEMS, UAB <support@idiles.com>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your opinion) any later version.
10 #
11 # This program is distributed in the hope that will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MECHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more detals.
15 #
16 # You shoud have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 # 02111-1307 USA
20 #
21
22 """
23 Character encodings
24 """
25
26 import wx
27
28 if wx.USE_UNICODE:
29     toWX = fromWX = lambda s: s
30 else:
31     import locale
32     localeCharset = locale.getpreferredencoding()
33    
34     def toWX(s):
35         return s.encode(localeCharset, 'replace')
36
37     def fromWX(s):
38         return unicode(s, localeCharset)
39
Note: See TracBrowser for help on using the browser.