Skip to content

Commit

Permalink
use utf-8 as encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
codestruct committed Apr 23, 2018
1 parent 32c84aa commit 7fb8332
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nxt/system.py
Expand Up @@ -217,7 +217,7 @@ def get_device_info(opcode):

def _parse_get_device_info(tgram):
tgram.check_status()
name = tgram.parse_string(15).decode('windows-1252').split('\0')[0]
name = tgram.parse_string(15).decode('utf-8').split('\0')[0]
a0 = tgram.parse_u8()
a1 = tgram.parse_u8()
a2 = tgram.parse_u8()
Expand Down
3 changes: 1 addition & 2 deletions nxt/telegram.py
Expand Up @@ -68,8 +68,7 @@ def add_string(self, n_bytes, v):
self.pkt.write(pack('%ds' % n_bytes, v.encode('windows-1252')))

def add_filename(self, fname):
#self.pkt.write(pack('20s', fname))
self.pkt.write(pack('20s', fname.encode('windows-1252')))
self.pkt.write(pack('20s', fname.encode('utf-8')))

def add_s8(self, v):
self.pkt.write(pack('<b', v))
Expand Down
2 changes: 1 addition & 1 deletion scripts/nxtfilemgr
Expand Up @@ -151,7 +151,7 @@ class NXTListing(Gtk.ListStore):
def populate(self, brick, pattern):
f = FileFinder(brick, pattern)
for (fname_b, size) in f:
fname = fname_b.decode('windows-1252')
fname = fname_b.decode('utf-8')
self.append((fname, str(size)))


Expand Down

0 comments on commit 7fb8332

Please sign in to comment.