Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2023 03:45:23 +0000
From:      bugzilla-noreply@freebsd.org
To:        office@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 269127] devel/icu: Multibyte character is included in DateTimePatterns for en locale in release 72
Message-ID:  <bug-269127-25061-zhm8d3mkjQ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-269127-25061@https.bugs.freebsd.org/bugzilla/>
References:  <bug-269127-25061@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@FreeBSD.org> has asked FreeBSD Office Team
<office@FreeBSD.org> for maintainer-feedback:
Bug 269127: devel/icu: Multibyte character is included in DateTimePatterns =
for
en locale in release 72
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269127



--- Description ---
For example, the following JavaScript code may produce unintended results.

(function () {
	var i, d=3D[], s=3D[];
	d[0] =3D new Date(0);
	s[0] =3D d[0].toLocaleString("en-US");
	d[1] =3D new Date(s[0]);
	console.log(d[0], s[0], d[1]);
	for (i =3D 0; i < s[0].length; ++i) {
		console.log(s[0].charAt(i), s[0].charCodeAt(i).toString(16));
	}
})();

d[1] is expected to be the same as d[0], but is "Invalid Date" in icu-depen=
dent
web browsers (firefox-esr-102.7.0,1, chromium-109.0.5414.74 and...
seamonkey-2.49.4_27 :) ).
The reason for this is that the string converted to LocaleString contains
U+202F.

One problem with this is that the en, en-* locale have been deified as not
containing multibyte characters in the language areas that use multibyte
characters (e.g. Japan :) ).
This is why they would choose this method.
In fact, there are sites that display "Invalid Date" because of this.

The problem with this is that it will behave differently with browsers that=
 are
not using icu.
As far as I have tried, Windows10+ChromeEdge and Android+Edge return
LocaleString without multibyte characters, which works as expected.

I think the distribution file for the port already has a database of the pa=
rts
related to this, but the source is this.
https://github.com/unicode-org/icu/blob/bb0e745e25c99cc57055caf45c81b95ef63=
b25d
4/icu4c/source/data/locales/en.txt

What should it be?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269127-25061-zhm8d3mkjQ>