Project

General

Profile

Actions

Misc #21975

open

Add "UTF-八" as an alias for UTF-8 encoding

Misc #21975: Add "UTF-八" as an alias for UTF-8 encoding
2

Added by ko1 (Koichi Sasada) 1 day ago. Updated about 15 hours ago.

Status:
Open
Assignee:
-
[ruby-core:125164]

Description

In Japan, legal texts must write all characters - including digits - using full-width or kanji forms. As a result, the encoding name "UTF-8"
appears as "UTF-八" (八 = eight in kanji) in official government notices.

Specifically, it appears in a notice issued by the Digital Agency and the Ministry of Internal Affairs and Communications (令和8年デジタル庁・総務省告示第12号), which defines character sets and encoding for local government information systems:

地方公共団体情報システムの標準化に関する法律第七条第一項に規定する各地方公共団体情報システムに共通する基準のうち電磁的記録において用いられる用語及び符号の相互運用性の確保その他の地方公共団体情報システムに係る互換性の確保に関する標準を定める命令第三条第二号の規定に基づき行政事務標準文字の文字セット及び地方公共団体情報システム間の連携のための文字符号化方式を定める告示

Reference: https://www.digital.go.jp/assets/contents/node/basic_page/field_ref_resources/d12bde7e-a950-493b-987c-0f8d4bbd1b6b/66117898/20260324_laws_notice_text_02.pdf

This patch https://github.com/ruby/ruby/pull/16623 adds "UTF-八" as an encoding alias for UTF-8, so that Ruby is compliant with Japanese law.

# encoding: UTF-八

p __ENCODING__ #=> #<Encoding:UTF-8>

p Encoding.find("UTF-八")              #=> #<Encoding:UTF-8>
p "hello".encode("UTF-八")             #=> "hello"
p "こんにちは".force_encoding("UTF-八") #=> "こんにちは"

p "こんにちは".encode("U
                      T
                      F
                      |
                      八") #=> "こんにちは"
Actions

Also available in: PDF Atom