Skip to content

Commit 0b6e9ec

Browse files
committed
Merge pull request #111 from ScottPJones/spj/utf16
Eliminate use of undocumented Base.utf16_* functions (Fix #110)
2 parents e583641 + 9f1ac5c commit 0b6e9ec

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Parser.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,8 @@ function parse_object{T<:AbstractString}(ps::ParserState{T}, ordered::Bool, obj)
134134
return obj
135135
end
136136

137-
if VERSION <= v"0.3-"
138-
utf16_is_surrogate(c::Uint16) = (c & 0xf800) == 0xd800
139-
utf16_get_supplementary(lead::Uint16, trail::Uint16) = char((lead-0xd7f7)<<10 + trail)
140-
else
141-
const utf16_is_surrogate = Base.utf16_is_surrogate
142-
const utf16_get_supplementary = Base.utf16_get_supplementary
143-
end
137+
utf16_is_surrogate(c::Uint16) = (c & 0xf800) == 0xd800
138+
utf16_get_supplementary(lead::Uint16, trail::Uint16) = @compat(Char(@compat(UInt32(lead-0xd7f7)<<10) + trail))
144139

145140
# TODO: Try to find ways to improve the performance of this (currently one
146141
# of the slowest parsing methods).

0 commit comments

Comments
 (0)