mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-07 01:22:49 -05:00
Revert "Fix disappearing end of the comments with emoji (#5587)"
This reverts commit 86c425b43f75dd1f22034bbfbd99476651661348.
This commit is contained in:
parent
47b5d79ec7
commit
e406028e25
@ -21,6 +21,8 @@ private def copy_string(str : String::Builder, iter : Iterator, count : Int) : I
|
|||||||
str << cp.chr
|
str << cp.chr
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# A codepoint from the SMP counts twice
|
||||||
|
copied += 1 if cp > 0xFFFF
|
||||||
copied += 1
|
copied += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -42,6 +44,10 @@ def parse_description(desc, video_id : String) : String?
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Not everything is stored in UTF-8 on youtube's side. The SMP codepoints
|
||||||
|
# (0x10000 and above) are encoded as UTF-16 surrogate pairs, which are
|
||||||
|
# automatically decoded by the JSON parser. It means that we need to count
|
||||||
|
# copied byte in a special manner, preventing the use of regular string copy.
|
||||||
iter = content.each_codepoint
|
iter = content.each_codepoint
|
||||||
|
|
||||||
index = 0
|
index = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user