Fix handling of utf-16 encoding of code point 0xE000. (CVS 4017)

FossilOrigin-Name: bfc35ce8673ce51f726535b90c1d86be272848bb
This commit is contained in:
danielk1977 2007-05-16 18:11:41 +00:00
parent 2be2be92c4
commit a9c16b0a38
4 changed files with 16 additions and 14 deletions

View File

@ -1,5 +1,5 @@
C Avoid\spassing\sa\snegative\svalue\sto\sisspace()\sin\sa\scouple\splaces.\s(CVS\s4016)
D 2007-05-16T17:50:46
C Fix\shandling\sof\sutf-16\sencoding\sof\scode\spoint\s0xE000.\s(CVS\s4017)
D 2007-05-16T18:11:41
F Makefile.in 87b200ad9970907f76df734d29dff3d294c10935
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -129,7 +129,7 @@ F src/test_tclvar.c 315e77c17f128ff8c06b38c08617fd07c825a95b
F src/tokenize.c 6cef9e6fc454d789a32c5b509ccb193a2b01977b
F src/trigger.c 420192efe3e6f03addf7897c60c3c8bf913d3493
F src/update.c 3359041db390a8f856d67272f299600e2104f350
F src/utf.c b881fe54498f6a35de424a62f8e071b621111728
F src/utf.c 9ac9672b3552455ff910954a2dbe626d9442819e
F src/util.c 80cdf6b68d03b8f0ab3237a390842e039cff66c6
F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef
F src/vdbe.c 51baf9ba77e986db857c69d63a979bb5227317ae
@ -213,7 +213,7 @@ F test/descidx2.test eb3a2882ec58aa6e1e8131d9bb54436e5b4a3ce2
F test/descidx3.test 3a55b8d73bc3e9ad084e0da7fec781cf0d2a0356
F test/diskfull.test a91fa95a8729b71fdac4738a49755f70b48c61f3
F test/distinctagg.test 2b89d1c5220d966a30ba4b40430338669301188b
F test/enc.test 7a03417a1051fe8bc6c7641cf4c8c3f7e0066d52
F test/enc.test 5792faf2dad78a1ff75e2d396a74b963be601815
F test/enc2.test 45710bacfa9df29720bc84c067dfdf8c8ddfb797
F test/enc3.test 9331988b9d72decec96995c90637e87b00d747a5
F test/exclusive.test 5bc520ba366ae3d242420af025ab64d465b04706
@ -492,7 +492,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 93f811ec747f6a42daf9ee27cd8b013f248552a1
R c67605dff2e838f24cfcf3d54b6e421f
P d5db8be3680e16a74edb385dfa3730c66d5f4fd6
R b4fd3cc8aead5f60341b0cebde166d7b
U danielk1977
Z 16ca321020c875a219eeb2a39861a462
Z 1c34f7d78c7722ce1118670b27ede75c

View File

@ -1 +1 @@
d5db8be3680e16a74edb385dfa3730c66d5f4fd6
bfc35ce8673ce51f726535b90c1d86be272848bb

View File

@ -12,7 +12,7 @@
** This file contains routines used to translate between UTF-8,
** UTF-16, UTF-16BE, and UTF-16LE.
**
** $Id: utf.c,v 1.48 2007/05/15 14:40:11 drh Exp $
** $Id: utf.c,v 1.49 2007/05/16 18:11:41 danielk1977 Exp $
**
** Notes on UTF-8:
**
@ -107,7 +107,7 @@ const unsigned char sqlite3UtfTrans1[] = {
#define READ_UTF16LE(zIn, c){ \
c = (*zIn++); \
c += ((*zIn++)<<8); \
if( c>=0xD800 && c<=0xE000 ){ \
if( c>=0xD800 && c<0xE000 ){ \
int c2 = (*zIn++); \
c2 += ((*zIn++)<<8); \
c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
@ -118,7 +118,7 @@ const unsigned char sqlite3UtfTrans1[] = {
#define READ_UTF16BE(zIn, c){ \
c = ((*zIn++)<<8); \
c += (*zIn++); \
if( c>=0xD800 && c<=0xE000 ){ \
if( c>=0xD800 && c<0xE000 ){ \
int c2 = ((*zIn++)<<8); \
c2 += (*zIn++); \
c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
@ -488,7 +488,7 @@ void sqlite3UtfSelfTest(){
assert( (z-zBuf)==n );
}
for(i=0; i<0x00110000; i++){
if( i>=0xD800 && i<=0xE000 ) continue;
if( i>=0xD800 && i<0xE000 ) continue;
z = zBuf;
WRITE_UTF16LE(z, i);
n = z-zBuf;
@ -499,7 +499,7 @@ void sqlite3UtfSelfTest(){
assert( (z-zBuf)==n );
}
for(i=0; i<0x00110000; i++){
if( i>=0xD800 && i<=0xE000 ) continue;
if( i>=0xD800 && i<0xE000 ) continue;
z = zBuf;
WRITE_UTF16BE(z, i);
n = z-zBuf;

View File

@ -13,7 +13,7 @@
# various suported unicode encodings (UTF-8, UTF-16, UTF-16le and
# UTF-16be).
#
# $Id: enc.test,v 1.5 2004/11/14 21:56:31 drh Exp $
# $Id: enc.test,v 1.6 2007/05/16 18:11:41 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -149,4 +149,6 @@ test_conversion enc-7 [string repeat "abcde\u00EF\u00EE\uFFFCabc" 100]
test_conversion enc-8 [string repeat "\u007E\u007F\u0080\u0081" 100]
test_conversion enc-9 [string repeat "\u07FE\u07FF\u0800\u0801\uFFF0" 100]
test_conversion enc-10 [string repeat "\uE000" 100]
finish_test