This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Sevenbit-strings only partially respected?
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Sat, 09 Oct 2010 23:04:58 +0200
- Subject: Re: Sevenbit-strings only partially respected?
- References: <201010092326.36112.ghost@cs.msu.su> <i8qgtp$89t$1@dough.gmane.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Sat, 09 Oct 2010 23:48:12 +0400
>
> > if (c < 0x20 || /* Low control chars */
> > (c >= 0x7F && c < 0xA0) || /* DEL, High controls */
> > (sevenbit_strings && c >= 0x80))
> > {/* high order bit set */
> >
> > Apparently, the second condition fires and causes 0xD0 to be quoted. Is
> > this expected behaviour?
>
> Doh. Of course 0xD0 is larger than 0xA0. The value that causes the actual
> problem is 0x83. Russian letter 'Ñ' is encoded in UTF8 as 0xD1 0x83, and
> because of the above code, strings with that letter (and some other letters)
> get messed up completely.
That `(c >= 0x7F && c < 0xA0)' condition assumes ISO-8859-n encodings
(probably was coded for 8859-1), and should not be used with anything
else.