Closed CAMOBAP closed 5 years ago
How strange. So it's not the Unicode that's bothering it, it's the mixing of Chinese and Roman script.
Rather than pore over the whys and wherefores, I'm HTML encoding this one-off instance of script mixing. Will see if that works.
Here 三
is shown as 三
. Is this string actually in UTF-8? I suspect not?
The issue is in line 113 of lib/isodoc/gb/metadata.rb.
stage = "#{iter.text.to_i.localize(:zh).spellout}次#{stage}" if iter
This uses the https://github.com/twitter/twitter-cldr-rb library to convert an iteration number (in this case "3") into a Chinese character. This works fine in Unix (三次); in Windows, the string it generates is mangled (Σ╕ë次), and is clearly being treated as three bytes and not UTF-8.
I'm trying out force_encoding("UTF-8") on the output of spellout
, and if that doesn't work, I'm passing back it to @CAMOBAP795.
No, force_encoding didn't work. @CAMOBAP795, over to you.
@opoudjis ok
Continue looking at https://github.com/twitter/twitter-cldr-rb I have some progress https://github.com/twitter/twitter-cldr-rb/blob/master/resources/locales/zh/rbnf.yml#L102 now it's time to understand how this config was opened
Here is problematic line https://github.com/twitter/twitter-cldr-rb/blob/master/lib/twitter_cldr/resources/loader.rb#L109 I have fixed it locally and it works, I'm going to provide PR
PR is submitted https://github.com/twitter/twitter-cldr-rb/pull/217
Our procedure when this has happened in the past is to fetch a local version of the gem until the PR is accepted. @CAMOBAP795, I will do so with your instance. Please let me know if and when the PR is accepted.
And we will leave the ticket open until it is...
During https://github.com/metanorma/metanorma-gb/pull/95 two test failure was observed
Looks like encoding issue:
good:
:stageabbr=>"Pre三次标准草案征求意见稿",
vs bad::stageabbr=>"PreΣ╕ë次标准草案征求意见稿"
cc @opoudjis