bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#481: Crashes with non-default language environments


From: Kenichi Handa
Subject: bug#481: Crashes with non-default language environments
Date: Wed, 25 Jun 2008 11:58:03 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

This is the thread of long ago.

In article <jwvk5lab0qd.fsf-monnier+emacs@gnu.org>, Stefan Monnier 
<monnier@IRO.UMontreal.CA> writes:

> > But, even if we implement string-to-unibyte, it should be
> > used for a string containing only ascii and eight-bit chars.
> > And in that case, string-make-unibyte behaves exactly the
> > same as string-to-unibyte.

> No it would be different: it would also signal an error if some
> non-binary char is found.  (I might potentially be convinced that it's
> OK to additionally accept the 128-255 latin1 chars as alternatives to
> eight-bit chars, since they now get character codes 128-255).

I've just installed a change to implement string-to-unibyte
as below and used it to fix the problem of jpeg detection.

(string-to-unibyte string &optional accept-latin-1)

Return a unibyte string with the same individual chars as string.
If string is unibyte, the result is string itself.
Otherwise it is a newly created string, with no text properties,
where each `eight-bit' character is converted to the corresponding byte.
If string contains a non-ASCII, non-`eight-bit' character,
an error is signalled.
If the optional 2nd arg accept-latin-1 is non-nil, a Latin-1 character
doesn't cause an error, but is converted to a byte of same code.

---
Kenichi Handa
handa@ni.aist.go.jp






reply via email to

[Prev in Thread] Current Thread [Next in Thread]