From: npostavs@users.sourceforge.net
To: Vjacheslav <fvamail@gmail.com>
Cc: 25288@debbugs.gnu.org
Subject: bug#25288: 25.1; term, ansi-term, broken output of utf8 text
Date: Wed, 28 Dec 2016 14:10:30 -0500 [thread overview]
Message-ID: <87r34r98ex.fsf@users.sourceforge.net> (raw)
In-Reply-To: <db3440f5-f045-87a7-0f67-a5eb2a5869c4@gmail.com> (Vjacheslav's message of "Wed, 28 Dec 2016 13:41:55 +0300")
found 25288 24.5
tags 25288 confirmed
quit
Vjacheslav <fvamail@gmail.com> writes:
> Trying to use this command from terminal running bash:
>
> [fva@localhost ~]$ python -c 'print "ш"*5000'
>
> produces garbage (шшш\321\210шшш) in output. Terminal needs
> reset. Possibly this is a bug which seen in very old linux, (breaks
> multibyte characters on buffer borders).
>
> default-process-coding-system is OK:
>
> default-process-coding-system is a variable defined in ‘C source code’.
> Its value is (utf-8-unix . utf-8-unix)
It looks like the problem is that the process filter function,
term-emulate-terminal, receives the output in chunks of 4096 bytes[1]. The
ш character is encoded in 2 bytes, which means it can be split across
chunks.
Is there a way to recognize incomplete decoding from lisp? I can't see
any.
[1]: It's getting bytes rather than characters because in term-exec-1 we
have:
;; The process's output contains not just chars but also binary
;; escape codes, so we need to see the raw output. We will have to
;; do the decoding by hand on the parts that are made of chars.
(coding-system-for-read 'binary))
next prev parent reply other threads:[~2016-12-28 19:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-28 10:41 bug#25288: 25.1; term, ansi-term, broken output of utf8 text Vjacheslav
2016-12-28 19:10 ` npostavs [this message]
2016-12-28 19:31 ` Eli Zaretskii
2016-12-29 2:37 ` npostavs
2016-12-29 16:06 ` Eli Zaretskii
2017-01-03 14:05 ` npostavs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r34r98ex.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=25288@debbugs.gnu.org \
--cc=fvamail@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.