5 ms·
$ echo "令和" | hexdump -C 00000000 e4 bb a4 e5 92 8c 0a |.......| 00000007 Obviously the individual kanjis are reserved in CJK plane. But how is it
by qlk1123 8y ago
$ echo "令和" | hexdump -C
00000000 e4 bb a4 e5 92 8c 0a |.......|
00000007
Obviously the individual kanjis are reserved in CJK plane. But how is it related to Y2K-esque bugs?
- james_s_tayler 8y agoBecause this stuff is hardcoded into the standard library (at least in Java I know it is) and I assume it's the same for other things. For example any dates in the future like 2020 will show up wrong. Where it ought to be reiwa 2 it will be Heisei 31 which doesn't even exist. Heaven forbid you were doing something crazy like matching on strings for the date etc you could get into a world of hurt. Mostly though you always work with real, actual dates and use the standard library support for the Japanese era date to calculate outputs for display only. Mostly it just means there are a few forms/invoices out there with a non-existent date on them but oh well.
- glandium 8y agoHeisei 31 is this year. Heisei 32 and above are the ones that don't exist.
- james_s_tayler 8y agoThankfully I don't live in Japan and have to deal with that system on a daily basis.
- Larrikin 8y agoIt's been thirty years since anyone has to touch that code.
- glandium 8y agoSome systems are even still on the previous era (shōwa). Some may even hit a Y2K-like problem in 2025 (shōwa 100).
- Smithalicious 8y agoI'm now imagining some kind of action movie where the emperor lives too long and a band of programmers have to assassinate them lest their code breaks.
- enqk 8y agoIsn’t Reiwa 1 also this year?
- fenomas 8y agoIt's both - dates through April 30 are Heisei 31, and dates from May 1 are Reiwa 1, is the official take.
- earthboundkid 8y agoWell, I don't foresee that causing any bugs.
- thaumasiotes 8y agoBugs of that type should have been worked out long ago; it is not the norm for the era change to coincide with the new year.
- Nullabillity 8y agoIt is not the norm to reset your date system every 30 or so years.
- thaumasiotes 8y ago...yes it is?
- glandium 8y agoFrom May 1st onwards, yes. Heisei 31 April 29, Heisei 31 April 30, Reiwa 1 May 1, Reiwa 1 May 2, etc.
- danbolt 8y agoA special character of the two kanji are combined into one for official document use. This has been reserved at U+32FF.