Skip to content

Commit b858bea

Browse files
committed
Fixed incorrect emoji substitution
(cherry picked from commit 3d91734)
1 parent 487e2da commit b858bea

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/UnicodeREPL.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function substitution(istr::AbstractString)
3636
"\\u(" * str
3737
else
3838
codepoint = m.match[1:end-1]
39-
Meta.parse("\"\\u$codepoint\"") * str[length(m.match)+1:end]
39+
Meta.parse("\"\\U$codepoint\"") * str[length(m.match)+1:end]
4040
end
4141
end
4242
return ostr

test/substitution.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ using UnicodeREPL
44
@testset "substitution" begin
55
@test UnicodeREPL.substitution("\\u(2560)\\u(2563)ello World!") == "╠╣ello World!"
66
@test UnicodeREPL.substitution("\\u(bed) \\u(cab) \\u(feed) \\u(dad) \\u(BEEF)") == "௭ ಫ ﻭ ත 뻯"
7+
@test UnicodeREPL.substitution("\\u(1F607) \\u(3b1)\\u(20E8)") == "😇 α⃨"
78
end

0 commit comments

Comments
 (0)