ICU-3019 add dectetion of UTF-EBCDIC signature
X-SVN-Rev: 16027
This commit is contained in:
parent
ffc6e513ad
commit
faa56bc083
@ -2424,8 +2424,12 @@ ucnv_detectUnicodeSignature( const char* source,
|
||||
*signatureLength=4;
|
||||
return "UTF-7";
|
||||
}
|
||||
}else if(start[0]=='\xDD' && start[1]== '\x73'&& start[2]=='\x66' && start[3]=='\x73'){
|
||||
*signatureLength=4;
|
||||
return "UTF-EBCDIC";
|
||||
}
|
||||
|
||||
|
||||
/* no known Unicode signature byte sequence recognized */
|
||||
*signatureLength=0;
|
||||
return NULL;
|
||||
|
@ -1469,7 +1469,9 @@ TestSignatureDetection(){
|
||||
"\x2B\x2F\x76\x38\x41", /* UTF-7 */
|
||||
"\x2B\x2F\x76\x39\x41", /* UTF-7 */
|
||||
"\x2B\x2F\x76\x2B\x41", /* UTF-7 */
|
||||
"\x2B\x2F\x76\x2F\x41" /* UTF-7 */
|
||||
"\x2B\x2F\x76\x2F\x41", /* UTF-7 */
|
||||
|
||||
"\xDD\x73\x66\x73" /* UTF-EBCDIC */
|
||||
};
|
||||
static const char* expected[] = {
|
||||
"UTF-16BE",
|
||||
@ -1491,7 +1493,8 @@ TestSignatureDetection(){
|
||||
"UTF-7",
|
||||
"UTF-7",
|
||||
"UTF-7",
|
||||
"UTF-7"
|
||||
"UTF-7",
|
||||
"UTF-EBCDIC"
|
||||
};
|
||||
static const int32_t expectedLength[] ={
|
||||
2,
|
||||
@ -1513,6 +1516,7 @@ TestSignatureDetection(){
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
4
|
||||
};
|
||||
int i=0;
|
||||
|
Loading…
Reference in New Issue
Block a user