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
@@ -194,7 +195,7 @@ - (sbjson_token_t)getStringToken:(NSObject**)token {
194
195
return sbjson_token_error;
195
196
}
196
197
197
- if (CFStringIsSurrogateHighCharacter (hi)) {
198
+ if (SBStringIsSurrogateHighCharacter (hi)) {
198
199
unichar lo;
199
200
200
201
if (![_stream haveRemainingCharacters: 6 ])
@@ -207,7 +208,7 @@ - (sbjson_token_t)getStringToken:(NSObject**)token {
207
208
return sbjson_token_error;
208
209
}
209
210
210
- if (!CFStringIsSurrogateLowCharacter (lo)) {
211
+ if (!SBStringIsSurrogateLowCharacter (lo)) {
211
212
self.error = @" Invalid low character in surrogate pair" ;
212
213
return sbjson_token_error;
213
214
}
You can’t perform that action at this time.
0 commit comments