[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guile can't find a chinese named file
From: |
Marko Rauhamaa |
Subject: |
Re: guile can't find a chinese named file |
Date: |
Fri, 17 Feb 2017 10:46:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Eli Zaretskii <address@hidden>:
>> From: Marko Rauhamaa <address@hidden>
>> Python uses the surrogate hole in the middle of the Unicode range to
>> represent such stray bytes, but only when naming files.
>
> IMO, it makes no sense to limit this to file names, because (a) you
> don't always know on all levels of the code which string is a file
> name or a part thereof; and (b) because situations where non-ASCII
> bytes cannot be properly decoded into Unicode happen with text that is
> not file names, and users still expect Emacs to silently produce the
> same byte stream on round-trip operations, e.g., when copying text
> from one file to another.
Python just barfs:
$ python3 -c "import sys; print(sys.stdin.read(30))" <<<$'\xdd'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib64/python3.5/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdd in position \
0: invalid continuation byte
The situation is a bit difficult to recover from.
Marko
- Re: guile can't find a chinese named file, (continued)
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/16
- Re: guile can't find a chinese named file, Marko Rauhamaa, 2017/02/16
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/16
- Re: guile can't find a chinese named file, Marko Rauhamaa, 2017/02/16
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/16
- Re: guile can't find a chinese named file, Marko Rauhamaa, 2017/02/16
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/16
- Re: guile can't find a chinese named file, David Kastrup, 2017/02/16
- Re: guile can't find a chinese named file, Marko Rauhamaa, 2017/02/16
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/17
- Re: guile can't find a chinese named file,
Marko Rauhamaa <=
- Re: guile can't find a chinese named file, David Kastrup, 2017/02/17
- Re: guile can't find a chinese named file, tomas, 2017/02/17
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/17
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/17
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/16
- Re: guile can't find a chinese named file, Marko Rauhamaa, 2017/02/16
- Re: guile can't find a chinese named file, Eli Zaretskii, 2017/02/16
- Re: guile can't find a chinese named file, Mike Gran, 2017/02/16
- Re: guile can't find a chinese named file, David Kastrup, 2017/02/16
- Re: guile can't find a chinese named file, Marko Rauhamaa, 2017/02/16