1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00
2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/sjis.c (BODY for FROM_LOOP): Treat the case
	ch >= 0x81 && ch2 < 0x40 as invalid.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/uhc.c (BODY for FROM_LOOP): Reject ch2 == 0xff as invalid.
	(BODY for TO_LOOP): Accept 0x7f. Increment outptr as needed.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/johab.c (BODY for TO_LOOP): After calling
	ucs4_to_ksc5601_sym, fix the conversion to JOHAB.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/t.61.c (to_ucs4): Change values of 0xa4, 0a6, 0xa8, 0xb4,
	0xb8.
	(from_ucs4): Change values of U+00A4, U+00BB, U+00ED.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/macintosh.c (HAS_HOLES): Set to 1.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/iso_6937.c (to_ucs4): Change values of 0x24 and 0xb4.
	(from_ucs4): Change values of U+00A4 and U+00ED.
	(BODY of TO_LOOP): Remove mapping from U+02DC to 0x0020.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/ansi_x3.110.c (from_ucs4): Change entry for 0xed.
	(BODY for TO_LOOP): Map U+2122, U+2126, not U+2022, U+2026.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/Makefile (gen-8bit-gap-modules): Remove isiri-3342.
	* iconvdata/isiri-3342.h: New file.
	* iconvdata/isiri-3342.c (HAS_HOLES): Avoid gaps >= 0xe0, but don't
	treat 0x80 as a gap.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* string/strxfrm.c (encoding_mask, encoding_byte): Remove.
	(utf8_encode): Use simple shifts instead.  Fix return value.
This commit is contained in:
Ulrich Drepper
2000-07-31 22:47:52 +00:00
parent 89533d414f
commit 5134584a32
12 changed files with 422 additions and 49 deletions

View File

@@ -46,24 +46,11 @@
#ifndef WIDE_CHAR_VERSION
/* These are definitions used by some of the functions for handling
UTF-8 encoding below. */
static const uint32_t encoding_mask[] =
{
~0x7ff, ~0xffff, ~0x1fffff, ~0x3ffffff
};
static const unsigned char encoding_byte[] =
{
0xc0, 0xe0, 0xf0, 0xf8, 0xfc
};
/* We need UTF-8 encoding of numbers. */
static inline int
utf8_encode (char *buf, int val)
{
char *startp = buf;
int retval;
if (val < 0x80)
@@ -76,11 +63,11 @@ utf8_encode (char *buf, int val)
int step;
for (step = 2; step < 6; ++step)
if ((val & encoding_mask[step - 2]) == 0)
if ((val & (~(uint32_t)0 << (5 * step + 1))) == 0)
break;
retval = step;
*buf = encoding_byte[step - 2];
*buf = (unsigned char) (~0xff >> step);
--step;
do
{
@@ -91,7 +78,7 @@ utf8_encode (char *buf, int val)
*buf |= val;
}
return buf - startp;
return retval;
}
#endif