Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v12.x] icu: broken date locale string format on zh-CN #35390

Closed
legendecas opened this issue Sep 28, 2020 · 9 comments
Closed

[v12.x] icu: broken date locale string format on zh-CN #35390

legendecas opened this issue Sep 28, 2020 · 9 comments
Labels
confirmed-bug Issues with confirmed bugs. i18n-api Issues and PRs related to the i18n implementation.

Comments

@legendecas
Copy link
Member

legendecas commented Sep 28, 2020

  • Version: v12.17.0-12.18.4
  • Platform: all
  • Subsystem: icu

What steps will reproduce the bug?

$ LANG=zh_CN.UTF-8 node -p 'new Date().toLocaleString()'
2020-9-28 3:33:35 ├F10: PM┤

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

node v12.16.3 (small-icu, English only)

$ LANG=zh_CN.UTF-8 node -p 'new Date().toLocaleString()'
2020-9-28 15:34:08

node v14.12.0 (full-icu)

$ LANG=zh_CN.UTF-8 node -p 'new Date().toLocaleString()'
2020/9/28 下午3:35:06

Both cases are correct.

What do you see instead?

Invalid and meaningless symbol characters "├F10: PM┤" in localized strings.

Additional information

Reverting #33337 (5c0232a, 2d76ae7) can fix the issue.

@richardlau
Copy link
Member

Have you installed the full-icu module? You may need to reinstall it so that it installs the full ICU data to match the version of ICU used in Node.js.

cc @nodejs/i18n-api

@watilde watilde added the i18n-api Issues and PRs related to the i18n implementation. label Sep 28, 2020
@legendecas
Copy link
Member Author

legendecas commented Sep 28, 2020

@richardlau v12.x is built with small-icu by default (doc). Is this issue possibly related to full-icu?

@richardlau
Copy link
Member

I wouldn't expect the Node.js 14 behaviour without full ICU. I can't remember if Node.js will ignore a full ICU install for the wrong version of ICU or would error/silently ignore it.

@legendecas
Copy link
Member Author

legendecas commented Sep 28, 2020

Yes, Node.js 14 behavior is expected to working with full-icu. The issue is not if the new Date().toLocaleString() result is localized or not. In v12.16.3, the locale result should be identical to the default English result (or some locales supported in icu-small, human-readable). However, starting from v12.17.0 there are unexpected symbols in the localized strings.

@srl295
Copy link
Member

srl295 commented Oct 29, 2020

the symbol ├F10: PM┤ sounds like absolutely no data was found, not even English.

@srl295 srl295 added confirmed-bug Issues with confirmed bugs. v12.x labels Oct 29, 2020
@srl295
Copy link
Member

srl295 commented Oct 29, 2020

repro'ed. Sounds like the data slicing had a failure. Some data is present, but not other data.

@richardlau
Copy link
Member

cc @nodejs/i18n-api Any idea what we should do with this one?

@srl295
Copy link
Member

srl295 commented Jun 2, 2021

@richardlau sorry, i have not looked into this any further

@targos
Copy link
Member

targos commented Apr 8, 2022

Closing this issue because v12.x goes EOL at the end of this month and no more releases are planned.

@targos targos closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. i18n-api Issues and PRs related to the i18n implementation.
Projects
None yet
Development

No branches or pull requests

5 participants