mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
raise on character conversion failure
This commit is contained in:
parent
0d61b42215
commit
73f3fb78ab
1 changed files with 5 additions and 2 deletions
|
@ -3418,8 +3418,11 @@ rangeOfCharacter_c(GSStr self, NSCharacterSet *aSet, unsigned mask,
|
|||
unsigned int s = 1;
|
||||
unichar *d = &u;
|
||||
|
||||
u = 0; // If conversion fails, we use zero
|
||||
GSToUnicode(&d, &s, &c, 1, internalEncoding, 0, 0);
|
||||
if (GSToUnicode(&d, &s, &c, 1, internalEncoding, 0, 0) == NO)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"unable to convert character to unicode"];
|
||||
}
|
||||
}
|
||||
/* FIXME ... what about UTF-16 sequences of more than one 16bit value
|
||||
* corresponding to a single UCS-32 codepoint?
|
||||
|
|
Loading…
Reference in a new issue