diff options
author | jerous <jerous@gmail.com> | 2008-10-15 21:19:29 +0200 |
---|---|---|
committer | jerous <jerous@gmail.com> | 2008-10-15 21:19:29 +0200 |
commit | bd543fb9c6683f72019fca66463f033ecb7dff5f (patch) | |
tree | dbe5ec57af0f6291c90e43d56a052727d1a69fd9 /mpd.py | |
parent | 7e75e58fa770368fb84800a0127927498782e63d (diff) |
better handling of UTF in mpd
showing progress when adding song to playlist
Diffstat (limited to 'mpd.py')
-rw-r--r-- | mpd.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -141,14 +141,17 @@ class MPDClient(object): self._commandlist.append(retval) def _writeline(self, line): - self._wfile.write("%s\n" % line) + self._wfile.write(("%s\n" % line).encode('utf-8')) self._wfile.flush() def _writecommand(self, command, args=[]): parts = [command] for arg in args: - parts.append('"%s"' % escape(str(arg))) - self._writeline(" ".join(parts)) + if type(arg)==int: + parts.append('"%i"' % arg) + else: + parts.append(u'"%s"' % escape(arg)) + self._writeline(u" ".join(parts)) def _readline(self): line = self._rfile.readline() |