/usr/share/pyshared/hachoir_wx/unicode.py is in python-hachoir-wx 0.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # -*- coding: utf-8 -*-
import wx
import locale
import sys
def get_charset():
try:
charset = locale.getdefaultlocale()[1]
except (locale.Error, NameError, AttributeError, IndexError):
pass
if charset is None:
charset = sys.getdefaultencoding()
return charset
def force_unicode(name):
if not isinstance(name, unicode):
charset = get_charset()
name = unicode(name, charset)
return name
|