mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-06 05:55:35 +00:00
ICU-12766 fix issue w/ u8 escaping
* greek tests now pass on solaris X-SVN-Rev: 39835
This commit is contained in:
parent
ddcaeb9cf4
commit
a1afc24f8c
2 changed files with 51 additions and 54 deletions
|
@ -14,17 +14,18 @@
|
|||
#include "unicode/utf8.h"
|
||||
|
||||
static const char
|
||||
kSPACE = 0x20,
|
||||
kTAB = 0x09,
|
||||
kLF = 0x0A,
|
||||
kCR = 0x0D,
|
||||
kHASH = 0x23,
|
||||
kSLASH = 0x2f,
|
||||
kSTAR = 0x2A,
|
||||
kL_U = 0x75,
|
||||
kU_U = 0x55,
|
||||
kQUOT = 0x27,
|
||||
kDBLQ = 0x22;
|
||||
kSPACE = 0x20,
|
||||
kTAB = 0x09,
|
||||
kLF = 0x0A,
|
||||
kCR = 0x0D,
|
||||
// kHASH = 0x23,
|
||||
// kSLASH = 0x2f,
|
||||
kBKSLASH = 0x5C,
|
||||
// kSTAR = 0x2A,
|
||||
kL_U = 0x75,
|
||||
kU_U = 0x55,
|
||||
kQUOT = 0x27,
|
||||
kDBLQ = 0x22;
|
||||
|
||||
std::string prog;
|
||||
|
||||
|
@ -52,17 +53,15 @@ int cleanup(const std::string &outfile) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
inline bool hasNonAscii(const char *line, size_t len) {
|
||||
const unsigned char *uline = reinterpret_cast<const unsigned char*>(line);
|
||||
for(size_t i=0;i<len; i++) {
|
||||
if( uline[i] > 0x7F) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
// inline bool hasNonAscii(const char *line, size_t len) {
|
||||
// const unsigned char *uline = reinterpret_cast<const unsigned char*>(line);
|
||||
// for(size_t i=0;i<len; i++) {
|
||||
// if( uline[i] > 0x7F) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
inline const char *skipws(const char *p, const char *e) {
|
||||
for(;p<e;p++) {
|
||||
|
@ -79,31 +78,29 @@ inline const char *skipws(const char *p, const char *e) {
|
|||
return p;
|
||||
}
|
||||
|
||||
#if 0
|
||||
inline bool isCommentOrEmpty(const char* line, size_t len) {
|
||||
const char *p = line;
|
||||
const char *e = line+len;
|
||||
p = skipws(p,e);
|
||||
if(p==e) {
|
||||
return true; // whitespace only
|
||||
}
|
||||
p++;
|
||||
switch(*p) {
|
||||
case kHASH: return true; // #directive
|
||||
case kSLASH:
|
||||
p++;
|
||||
if(p==e) return false; // single slash
|
||||
switch(*p) {
|
||||
case kSLASH: // '/ /'
|
||||
case kSTAR: // '/ *'
|
||||
return true; // start of comment
|
||||
default: return false; // something else
|
||||
}
|
||||
default: return false; // something else
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
#endif
|
||||
// inline bool isCommentOrEmpty(const char* line, size_t len) {
|
||||
// const char *p = line;
|
||||
// const char *e = line+len;
|
||||
// p = skipws(p,e);
|
||||
// if(p==e) {
|
||||
// return true; // whitespace only
|
||||
// }
|
||||
// p++;
|
||||
// switch(*p) {
|
||||
// case kHASH: return true; // #directive
|
||||
// case kSLASH:
|
||||
// p++;
|
||||
// if(p==e) return false; // single slash
|
||||
// switch(*p) {
|
||||
// case kSLASH: // '/ /'
|
||||
// case kSTAR: // '/ *'
|
||||
// return true; // start of comment
|
||||
// default: return false; // something else
|
||||
// }
|
||||
// default: return false; // something else
|
||||
// }
|
||||
// /*NOTREACHED*/
|
||||
// }
|
||||
|
||||
void appendByte(std::string &outstr,
|
||||
uint8_t byte) {
|
||||
|
@ -156,7 +153,7 @@ bool fixu8(std::string &linestr, size_t origpos, size_t &endpos) {
|
|||
outstr += (kDBLQ);
|
||||
for(;pos<endpos;pos++) {
|
||||
char c = linestr[pos];
|
||||
if(c == kSLASH) {
|
||||
if(c == kBKSLASH) {
|
||||
char c2 = linestr[++pos];
|
||||
switch(c2) {
|
||||
case kQUOT:
|
||||
|
|
|
@ -8,9 +8,9 @@ u"\U000219F2";
|
|||
u"sa\u0127\u0127a";
|
||||
u'\u6587'; u"\U000219F2";
|
||||
|
||||
"\x20\x5C\x75\x30\x33\x30\x31";
|
||||
"\x5C\x75\x30\x33\x30\x38\x20";
|
||||
"\x73\x61\x5C\x75\x30\x31\x32\x37\x5C\x75\x30\x31\x32\x37\x61";
|
||||
"\x5C\x75\x36\x35\x38\x37";
|
||||
"\x5C\x55\x30\x30\x30\x32\x31\x39\x46\x32";
|
||||
"\x73\x61\x5C\x75\x30\x31\x32\x37\x5C\x75\x30\x31\x32\x37\x61";
|
||||
"\x20\xCC\x81";
|
||||
"\xCC\x88\x20";
|
||||
"\x73\x61\xC4\xA7\xC4\xA7\x61";
|
||||
"\xE6\x96\x87";
|
||||
"\xF0\xA1\xA7\xB2";
|
||||
"\x73\x61\xC4\xA7\xC4\xA7\x61";
|
||||
|
|
Loading…
Add table
Reference in a new issue