<i18n dev> RFR: 8356980: Better handling of non-breaking space

Magnus Ihse Bursie ihse at openjdk.org
Wed May 14 15:16:18 UTC 2025


Non-breaking space characters are problematic. They look identical to the normal space character, but is not. For that reason, it should never be typed as an UTF-8 literal, but only by using unicode sequences.

I have checked:
* U+00A0 NO-BREAK SPACE (NBSP)
* U+202F NARROW NO-BREAK SPACE (NNBSP)
* U+2007 FIGURE SPACE
* U+2060 WORD JOINER

In some places, these character were used when an ordinary space should have been used. I replaced those with normal space. In other places, they were correct, but as literals instead of unicode sequences. I replaced those instances with sequences.

-------------

Commit messages:
 - Use sequences for valid nbsp usage
 - Remove mistaken nbsp

Changes: https://git.openjdk.org/jdk/pull/25234/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25234&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356980
  Stats: 36 lines in 8 files changed: 0 ins; 2 del; 34 mod
  Patch: https://git.openjdk.org/jdk/pull/25234.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25234/head:pull/25234

PR: https://git.openjdk.org/jdk/pull/25234


More information about the i18n-dev mailing list