unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bites assumed set mid UTF-8
@ 2006-03-06 18:15 Dan Jacobson
  2006-03-07  4:52 ` Kenichi Handa
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Jacobson @ 2006-03-06 18:15 UTC (permalink / raw)
  Cc: handa

Bad bad bad. Emacs 21.4.1 shows the same Chinese character ("nuclear")
even though the second bit string is not valid UTF-8. Cc'd Handa.
11100110 10100000 10111000
11100110 00100000 10111000
M-x compile this makefile

B=perl -wle '$$_=unpack "B*", <>; s/.{8}/$$& /g; print'
Q=qp-decode
a:
	for i in =E6=A0=B8 =E6\ =B8; do \
	echo $$i|$Q; echo -n $$i|$Q|$B; done
#echo =E6=A0=B8|qp-decode #Chinese "nuclear"
#echo =E6 =B8  |qp-decode #Not legal Unicode

uxterm etc. correctly displays only the first.

Save what you see into a file and indeed they are both the first.
Reality hits when one first saves it into a file bypassing emacs
display, and then find-files it. Thereupon the second version is not
coerced into being the same as the first, and emacs guesses the file
is latin-1.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bites assumed set mid UTF-8
  2006-03-06 18:15 bites assumed set mid UTF-8 Dan Jacobson
@ 2006-03-07  4:52 ` Kenichi Handa
  0 siblings, 0 replies; 2+ messages in thread
From: Kenichi Handa @ 2006-03-07  4:52 UTC (permalink / raw)
  Cc: bug-gnu-emacs, handa

In article <87r75fignl.fsf@jidanni.org>, Dan Jacobson <jidanni@jidanni.org> writes:

> Bad bad bad. Emacs 21.4.1 shows the same Chinese character ("nuclear")
> even though the second bit string is not valid UTF-8. Cc'd Handa.
> 11100110 10100000 10111000
> 11100110 00100000 10111000

Thank you for the report.  It is already fixed in the latest
CVS code.  With it, the second byte sequence (invalid utf-8)
is decoded into "\346 \270" (i.e. 8-bit-char #xe6, SPC,
8-bit-char #xb8).

---
Kenichi Handa
handa@m17n.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-07  4:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-06 18:15 bites assumed set mid UTF-8 Dan Jacobson
2006-03-07  4:52 ` Kenichi Handa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).