sparklemotion/nokogiri

JRuby: UtfHelpper.writeCharToUtf8 cannot handle unicode supplementary character

开放

#2,410 创建于 2022年1月5日

 (9 条评论) (0 个反应) (0 位负责人)Ruby (806 个派生)batch import
blockedhelp wantedplatform/jrubytopic/encoding

仓库指标

星标
 (5,615 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

https://github.com/sparklemotion/nokogiri/blob/55029bfba481338825c99e78af2b182b1cc49e04/ext/java/nokogiri/internals/c14n/UtfHelpper.java#L51

since the Canonicalizer process input String character by character. Java uses 16 bits to represent a character; when the input string contains Unicode characters whose code pen are larger than 0Xffff(65535) it will be split into two char, since neither char will not be
recognized, the Unicode characters will be transferred to 2 ??(3f) instead.

for example, if I want to canonicalize an input that contains 𡏅 via c14n, in the output, 𡏅 will be replaced with ??

贡献者指南