プロジェクト

全般

プロフィール

Vote #81263

完了

Remove unsupported encodings ISO-2022-KR and ISCII91 from Setting::ENCODINGS

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
152
issue_org_id:
34750
author_id:
332
assigned_to_id:
332
comments:
4
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

ISO-2022-KR and ISCII91 are no longer supported by Ruby. These encodings should be removed from @Setting::ENCODINGS@ constant.

Iconv library used in Redmine 2.6 and earlier supported these two encodings, but @String#encode@ used in Redmine 3.0 and later does not.

$ ruby -e '"foo".encode("ISO-2022-KR")'
Traceback (most recent call last):
    1: from -e:1:in `
' -e:1:in `encode': code converter not found (UTF-8 to ISO-2022-KR) (Encoding::ConverterNotFoundError)
$ ruby -e '"foo".encode("ISCII91")'
Traceback (most recent call last):
    1: from -e:1:in `
' -e:1:in `encode': code converter not found (UTF-8 to ISCII91) (Encoding::ConverterNotFoundError)
$ ruby -e 'p Encoding.list.map(&:to_s)'
["ASCII-8BIT", "UTF-8", "US-ASCII", "UTF-16BE", "UTF-16LE", "UTF-32BE", "UTF-32LE", "UTF-16", "UTF-32", "UTF8-MAC", "EUC-JP", "Windows-31J", "Big5", "Big5-HKSCS", "Big5-UAO", "CP949", "Emacs-Mule", "EUC-KR", "EUC-TW", "GB2312", "GB18030", "GBK", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-11", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "ISO-8859-16", "KOI8-R", "KOI8-U", "Shift_JIS", "Windows-1250", "Windows-1251", "Windows-1252", "Windows-1253", "Windows-1254", "Windows-1257", "IBM437", "IBM737", "IBM775", "CP850", "IBM852", "CP852", "IBM855", "CP855", "IBM857", "IBM860", "IBM861", "IBM862", "IBM863", "IBM864", "IBM865", "IBM866", "IBM869", "Windows-1258", "GB1988", "macCentEuro", "macCroatian", "macCyrillic", "macGreek", "macIceland", "macRoman", "macRomania", "macThai", "macTurkish", "macUkraine", "CP950", "CP951", "IBM037", "stateless-ISO-2022-JP", "eucJP-ms", "CP51932", "EUC-JIS-2004", "GB12345", "ISO-2022-JP", "ISO-2022-JP-2", "CP50220", "CP50221", "Windows-1256", "Windows-1255", "TIS-620", "Windows-874", "MacJapanese", "UTF-7", "UTF8-DoCoMo", "SJIS-DoCoMo", "UTF8-KDDI", "SJIS-KDDI", "ISO-2022-JP-KDDI", "stateless-ISO-2022-JP-KDDI", "UTF8-SoftBank", "SJIS-SoftBank"]
$ ruby -e 'p Encoding.list.map(&:to_s)' | grep -ci -e ISO-2022-KR -e ISCII9
0
$ curl -O https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz
$ tar xvf ruby-2.7.2.tar.gz
$ cd ruby-2.7.2
$ grep -ir -e ISO-2022-KR -e ISCII9 *
$

journals

--------------------------------------------------------------------------------
Go MAEDA wrote:
> Iconv library used in Redmine 2.6 and earlier supported these two encodings, but @String#encode@ used in Redmine 3.0 and later does not.

This is not correct. Redmine from 2.3 to 2.6 uses Iconv only when it runs on Ruby 1.8 (see source:tags/2.6.10/lib/redmine/codeset_util.rb#L1).

|_. Redmine version |_. Ruby version |_. uses Iconv? |
|=. < 2.3 |=. - |=. yes |
|=. 2.3 to 2.6 |=. 1.8 |=. yes |
|=. 2.3 to 2.6 |=. >= 1.9 |=. no |
|=. >= 3.0 |=. - |=. no |

So, ISO-2022-KR and ISCII91 are available only when all of the following conditions are met.

* Redmine version is 2.6.x or earlier
* Ruby version is 1.8.x or earlier

--------------------------------------------------------------------------------
Setting the target version to 4.2.0.
--------------------------------------------------------------------------------
Committed the patch.
--------------------------------------------------------------------------------

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0