Defect #36377

Encoding drop-down in the import settings defaults to US-ASCII instead of general_csv_encoding in Korean, Thai, and Shimplified Chinese

Added by Go MAEDA 27 days ago. Updated 26 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Importers
Target version:5.0.0
Resolution:Fixed Affected version:

Description

The "Encoding" drop-down is supposed to default to the encoding defined by general_csv_encoding in config/locales/*.yml files. For example, it should default to "ISO-8859-1" when the language of your account is English.

However, the drop-down always defaults to "US-ASCII" regardless of general_csv_encoding if the language of the current user is Korean (ko), Thai (th), or Simplified Chinese (zh).

This is because the value of general_csv_encoding in those languages is not found in Setting::ENCODINGS in app/models/setting.rb.

Language general_csv_encoding How to fix
Korean CP949 Add CP949 to Setting::ENCODINGS
Thai Windows-874 Add Windows-874 to Setting::ENCODINGS
Simplified Chinese gb18030 Change general_csv_encoding in zh.yml from gb18030 to GB18030

wrong-default-encoding.png (102 KB) Go MAEDA, 2022-01-01 08:26

36377.patch Magnifier (2.69 KB) Go MAEDA, 2022-01-01 09:13

Associated revisions

Revision 21335
Added by Go MAEDA 26 days ago

Fix that encoding drop-down in the import settings defaults to US-ASCII instead of general_csv_encoding in Korean (#36377).

Patch by Go MAEDA.

Revision 21336
Added by Go MAEDA 26 days ago

Fix that encoding drop-down in the import settings defaults to US-ASCII instead of general_csv_encoding in Thai (#36377).

Patch by Go MAEDA.

Revision 21337
Added by Go MAEDA 26 days ago

Fix that encoding drop-down in the import settings defaults to US-ASCII instead of general_csv_encoding in Simplified Chinese (#36377).

Patch by Go MAEDA.

Revision 21338
Added by Go MAEDA 26 days ago

Test if the encoding drop-down in the import settings includes all CSV encodings (#36377).

Patch by Go MAEDA.

History

#1 Updated by Go MAEDA 27 days ago

  • File 36377.patchMagnifier added
  • Subject changed from Encoding drop-down in the import settings defaults to US-ASCII instead of general_csv_encoding in some languages to Encoding drop-down in the import settings defaults to US-ASCII instead of general_csv_encoding in Korean, Thai, and Shimplified Chinese
  • Target version set to Candidate for next minor release

Here is a patch to fix the issue.

#2 Updated by Go MAEDA 26 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from Candidate for next minor release to 5.0.0
  • Resolution set to Fixed

Fixed in r21335, r21336, r21337, and r21338

Also available in: Atom PDF