mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-2404 fully handle <subchar1> and |2 in converters
X-SVN-Rev: 13523
This commit is contained in:
parent
4614bfe102
commit
47ca718f33
3 changed files with 10 additions and 2 deletions
|
@ -663,7 +663,7 @@ ucnv_extMatchFromU(const int32_t *cx,
|
|||
|
||||
/* return result */
|
||||
if(matchValue==UCNV_EXT_FROM_U_SUBCHAR1) {
|
||||
return 1;
|
||||
return 1; /* assert matchLength==2 */
|
||||
}
|
||||
|
||||
*pMatchValue=UCNV_EXT_FROM_U_MASK_ROUNDTRIP(matchValue);
|
||||
|
|
|
@ -269,6 +269,12 @@
|
|||
* (i.e., "no mapping" with preference for <subchar1> rather than <subchar>),
|
||||
* and all other items are unique non-zero results.
|
||||
*
|
||||
* The default value of a fromUTableValues[] section that is referenced
|
||||
* _directly_ from a fromUStage3b[] item may also be UCNV_EXT_FROM_U_SUBCHAR1,
|
||||
* but this value must not occur anywhere else in fromUTableValues[]
|
||||
* because "no mapping" is always a property of a single code point,
|
||||
* never of multiple.
|
||||
*
|
||||
*
|
||||
* char fromUBytes[];
|
||||
*
|
||||
|
|
|
@ -3026,7 +3026,9 @@ getTrail:
|
|||
cnv->fromUnicodeStatus=prevLength; /* save the old state */
|
||||
value=MBCS_VALUE_2_FROM_STAGE_2(bytes, stage2Entry, c);
|
||||
if(value<=0xff) {
|
||||
if(prevLength<=1) {
|
||||
if(value==0 && MBCS_FROM_U_IS_ROUNDTRIP(stage2Entry, c)==0) {
|
||||
/* no mapping, leave value==0 */
|
||||
} else if(prevLength<=1) {
|
||||
length=1;
|
||||
} else {
|
||||
/* change from double-byte mode to single-byte */
|
||||
|
|
Loading…
Add table
Reference in a new issue