Skip to content

Commit

Permalink
8087 text-install: UnicodeDecodeError: 'ascii' codec can't decode byt…
Browse files Browse the repository at this point in the history
…e 0xc3 in position 0: ordinal not in range(128) (#22)
  • Loading branch information
Alexander Pyhalov committed Apr 24, 2017
1 parent 8d74228 commit df7a777
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions usr/src/cmd/slim-install/svc/live-sysidtool-system
Expand Up @@ -49,6 +49,7 @@ then
if [ -x /usr/bin/mate-session ]; then
echo '[Desktop]' > /jack/.dmrc
echo 'Session=mate' >> /jack/.dmrc
echo 'Language=en_US.UTF-8' >> /jack/.dmrc
fi

#
Expand Down
1 change: 1 addition & 0 deletions usr/src/cmd/slim-install/user/jack/dmrc
@@ -1,2 +1,3 @@
[Desktop]
Session=gnome
Language=en_US.UTF-8
Expand Up @@ -344,8 +344,8 @@ def add_text(self, text, start_y=0, start_x=0, max_chars=None,
if centered:
start_x = (max_x - textwidth(text)) / 2 + start_x

if isinstance(text, unicode):
text = text.encode(get_encoding())
text = unicode(text)
text = text.encode(get_encoding())
logging.log(LOG_LEVEL_INPUT, "calling addstr with params start_y=%s,"
"start_x=%s, text=%s", start_y, start_x, text)
self.window.addstr(start_y, start_x, text)
Expand Down
Expand Up @@ -152,7 +152,11 @@ def make_screen_list(main_win):


if __name__ == '__main__':
locale.setlocale(locale.LC_ALL, "")
loc = locale.getdefaultlocale()
if loc[1] != 'UTF-8':
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
else:
locale.setlocale(locale.LC_ALL, "")
gettext.install("textinstall", "/usr/share/locale", unicode=True)
if os.getuid() != 0:
print _("The %(release)s Text Installer must be run with "
Expand Down

0 comments on commit df7a777

Please sign in to comment.