File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 32
32
#import " SBJsonTokeniser.h"
33
33
#import " SBJsonUTF8Stream.h"
34
34
35
- #define SBStringIsIllegalSurrogateHighCharacter (x ) (((x) >= 0xd800 ) && ((x) <= 0xdfff ))
36
-
35
+ #define SBStringIsIllegalSurrogateHighCharacter (character ) (((character) >= 0xD800UL ) && ((character) <= 0xDFFFUL ))
36
+ #define SBStringIsSurrogateLowCharacter (character ) ((character >= 0xDC00UL ) && (character <= 0xDFFFUL ))
37
+ #define SBStringIsSurrogateHighCharacter (character ) ((character >= 0xD800UL ) && (character <= 0xDBFFUL ))
37
38
38
39
@implementation SBJsonTokeniser
39
40
@@ -193,7 +194,7 @@ - (sbjson_token_t)getStringToken:(NSObject**)token {
193
194
return sbjson_token_error;
194
195
}
195
196
196
- if (CFStringIsSurrogateHighCharacter (hi)) {
197
+ if (SBStringIsSurrogateHighCharacter (hi)) {
197
198
unichar lo;
198
199
199
200
if (![_stream haveRemainingCharacters: 6 ])
@@ -206,7 +207,7 @@ - (sbjson_token_t)getStringToken:(NSObject**)token {
206
207
return sbjson_token_error;
207
208
}
208
209
209
- if (!CFStringIsSurrogateLowCharacter (lo)) {
210
+ if (!SBStringIsSurrogateLowCharacter (lo)) {
210
211
self.error = @" Invalid low character in surrogate pair" ;
211
212
return sbjson_token_error;
212
213
}
You can’t perform that action at this time.
0 commit comments