3 ms·
> ISO 8601 uses a hyphen character (in Unicode, U+2010 HYPHEN "‐") and minus character (in Unicode, U+2212 MINUS "−"). When using character sets which don't hav
by lifthrasiir 3y ago
> ISO 8601 uses a hyphen character (in Unicode, U+2010 HYPHEN "‐") and minus character (in Unicode, U+2212 MINUS "−").
When using character sets which don't have these characters a hyphen-minus character (in Unicode, U+2D HYPHEN-MINUS "-") should be used instead.
This is incorrect. What ISO 8601 actually specifies is that, if the target character set is based on ISO/IEC 646 (which definitely includes Unicode), then a hyphen-minus character should be used for both cases. There is a slight ambiguity here (e.g. what if some charset contains most but not all characters in 646?) but in the case of Unicode the interpretation is clear. I believe this is a roundabout way to specify the canonical mapping for 646 and guarantee the compatibility with other charsets based on 646.
- ijmacd 3y agoThat's very interesting. The relevant paragraph from the standard is in ISO 8601-1:2019 §3.2.1: > All characters used in date and time expressions and representations are part of the ISO/IEC 646 repertoire, except for “hyphen”, “minus” and “plus-minus”. In an environment where use is made of a character repertoire based on ISO/IEC 646, “hyphen” and “minus” should be both mapped onto “hyphen-minus”. And as you correctly state, Unicode is based on ISO 8859 which is based on ISO 646. So it would seem the intention really is to use U+2D hyphen-minus when Unicode is the character set.
- deleted 3y ago[deleted]