Feature #16233

winruby UTF8 Fallback for no CodePage

Added by gabuscus (Gabriel Nagy) about 1 year ago. Updated 28 days ago.

Target version:


This is to deal specifically with setting the Region to Arabic which
sets the codepage to 720. This codepage isn't recognised by Ruby which
causes it to fail during initialisation when setting up LOCALE.

This patch to Ruby is necessary to handle languages/regions on windows
where the codepage is not supported by Ruby such as Arabic which uses
codepage 720.
If the codepage is not found, the Locale falls back to UTF8.

This is a well known Ruby/Ruby on Rails issue which is described at

Opened PR:


windows_nocodepage_utf8_fallback_r2.5.patch (946 Bytes) windows_nocodepage_utf8_fallback_r2.5.patch patch to fix the issue gabuscus (Gabriel Nagy), 10/03/2019 07:27 AM

Updated by gabuscus (Gabriel Nagy) about 1 year ago

  • Description updated (diff)

Updated by duerst (Martin Dürst) about 1 year ago

If codepage 720 is not supported, then we should look at supporting it.

Updated by gabuscus (Gabriel Nagy) about 1 year ago

duerst (Martin Dürst) wrote:

If codepage 720 is not supported, then we should look at supporting it.

fair point, however investigation on this Puppet ticket: concluded that falling back to UTF-8 fixes the issue (for codepage 720 at least). we could also check the codepage when catching the ArgumentError so we fallback only in that case

edit: also I'm not sure what does adding a new codepage entail? I agree that would be the cleaner solution


Updated by hsbt (Hiroshi SHIBATA) 10 months ago

  • Tags set to patch, win, encoding

Updated by naruse (Yui NARUSE) 10 months ago

  • Backport deleted (2.5: UNKNOWN, 2.6: UNKNOWN)
  • ruby -v deleted (2.6.3)
  • Target version set to 36
  • Assignee set to duerst (Martin Dürst)
  • Tracker changed from Bug to Feature

Updated by duerst (Martin Dürst) 10 months ago

Will do, but probably not very soon, because it's now the most busy time of the year at work, sorry.

Some notes: For the encoding (onigX), windows-1256 is a replica of iso-8859-6. But windows-1256 is much more complete, while iso-8859-6 has many unassigned codepoints, so it may be a good idea to fix this if we get around to it.

Just adding an alias 'CP720' for windows-1256 is much easier.


Updated by hsbt (Hiroshi SHIBATA) 28 days ago

  • Target version changed from 36 to 3.0

Also available in: Atom PDF