mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Support 3 and 4-byte unicode characters.
John Hansen
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/conv.c,v 1.52 2005/03/07 04:30:52 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/conv.c,v 1.53 2005/06/15 00:15:08 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -361,12 +361,19 @@ UtfToLocal(unsigned char *utf, unsigned char *iso,
|
||||
iutf = *utf++ << 8;
|
||||
iutf |= *utf++;
|
||||
}
|
||||
else
|
||||
else if (l == 3)
|
||||
{
|
||||
iutf = *utf++ << 16;
|
||||
iutf |= *utf++ << 8;
|
||||
iutf |= *utf++;
|
||||
}
|
||||
else if (l == 4)
|
||||
{
|
||||
iutf = *utf++ << 24;
|
||||
iutf |= *utf++ << 16;
|
||||
iutf |= *utf++ << 8;
|
||||
iutf |= *utf++;
|
||||
}
|
||||
p = bsearch(&iutf, map, size,
|
||||
sizeof(pg_utf_to_local), compare1);
|
||||
if (p == NULL)
|
||||
|
||||
Reference in New Issue
Block a user