ICU-544 reject first surrogate in toUnicode surrogate-pair state

X-SVN-Rev: 2766
This commit is contained in:
Markus Scherer 2000-10-23 23:47:10 +00:00
parent 772e51f3dd
commit f0f6535381

View File

@ -571,6 +571,10 @@ MBCSAddToUnicode(MBCSData *mbcsData,
case 16|MBCS_STATE_VALID_16_PAIR:
/* bits 26..16 are not used, 0 */
/* bits 15..7 contain the final offset delta to two 16-bit code units */
if(UTF_IS_FIRST_SURROGATE(c)) {
fprintf(stderr, "error: cannot assign single first surrogate to surrogate-pair state: %lx (U+%lx)\n", b, c);
return FALSE;
}
offset+=(uint16_t)entry>>7;
if(isFallback>0) {
/* assign only if there is no precise mapping */