hughsie / colord

Making color management just work
GNU General Public License v2.0
75 stars 51 forks source link

Friulian locale trips up icc generation #121

Open jtojnar opened 3 years ago

jtojnar commented 3 years ago

During colord build, I have been getting the following warning:

[161/221] Generating x11-colors.icc with a custom commandne.so.p/cd-plugin-sane.c.o

(cd-create-profile:2036): libcolord-WARNING **: 10:29:01.777: failed to parse localized text Col?rs X11[fur]: ignoring invalid country code: fur

Looks like colord does not like the three letter language code for Friulian:

https://github.com/hughsie/colord/blob/4534c166c1f65fc0a032b2718a41571021ae88fb/lib/colord/cd-icc.c#L1294-L1300

It also weirdly calls it country code even though there is no country code (it would be in split[1]).

hughsie commented 3 years ago

IIRC, the ICC specification only allows a two character ISO 639-1 language code, and a two letter ISO 3166-1 country code. According to https://en.wikipedia.org/wiki/Friulian_language there's a ISO 639-2 and ISO 639-3 code, but no ISO 639-1 language code. Maybe I just skip fur?

jtojnar commented 3 years ago

Looking at the specification, you are right – the struct only reserves 2 bytes for the language code. Since there are many languages without Alpha-2 code, would it make sense to report it to ICC so they can possibly address it in future versions of the spec?

hughsie commented 3 years ago

would it make sense to report it to ICC

It's certainly worth trying, but the ICC group has failed to convince everyone to upgrade to V4 from V2, so getting a V6 would be very hard work...