iTerm2 color schemes can not be parsed when using a non-english locale #1

Closed
opened 2026-01-30 21:39:27 +00:00 by claunia · 2 comments
Owner

Originally created by @MindGirl on GitHub (Aug 12, 2017).

When trying to apply an iTerm2 color scheme on a computer with a German locale, the scheme can not be parsed (and applied).

Error message:

schemes\deuteranopia.itermcolors
Invalid Color
Invalid scheme - did not find 16 colors
Error loading ini file "./schemes\deuteranopia.itermcolors"
    for key "DARK_BLACK"
    the value "" is invalid
Could not find or load "schemes\deuteranopia.itermcolors"
Press any key to continue . . .

I tracked it down to Convert.ToDouble used in 1be2939f25/tools/ColorTool/ColorTool/XmlSchemeParser.cs (L48) which will use the current locale to parse the value. Because we use a comma as decimal separator and the dot as group separator, the values are invalid.

I created a pull request (#1: Use invariant culture for parsing double values)

Originally created by @MindGirl on GitHub (Aug 12, 2017). When trying to apply an iTerm2 color scheme on a computer with a German locale, the scheme can not be parsed (and applied). Error message: ``` schemes\deuteranopia.itermcolors Invalid Color Invalid scheme - did not find 16 colors Error loading ini file "./schemes\deuteranopia.itermcolors" for key "DARK_BLACK" the value "" is invalid Could not find or load "schemes\deuteranopia.itermcolors" Press any key to continue . . . ``` I tracked it down to Convert.ToDouble used in https://github.com/Microsoft/console/blob/1be2939f257bc89136bd6ea2ee04cdf75d12f3f0/tools/ColorTool/ColorTool/XmlSchemeParser.cs#L48 which will use the current locale to parse the value. Because we use a comma as decimal separator and the dot as group separator, the values are invalid. I created a pull request (#1: Use invariant culture for parsing double values)
claunia added the Product-Colortool label 2026-01-30 21:39:27 +00:00
Author
Owner

@christian-korneck commented on GitHub (Aug 12, 2017):

👍

@christian-korneck commented on GitHub (Aug 12, 2017): :+1:
Author
Owner

@khouzam commented on GitHub (Aug 14, 2017):

This has been merged.

@khouzam commented on GitHub (Aug 14, 2017): This has been merged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1