Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-164687

No-Break Space (U+00A0) does not act as a "no-break" space in chat messages and commands issued by players

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 19w42a, 20w09a, 20w10a, 20w17a, 20w19a, 1.16 Pre-release 4, 1.17, 1.17.1 Pre-release 1, 1.19.1, 23w07a, 1.19.4, 23w12a, 23w13a, 23w14a, 23w17a, 1.20 Pre-release 4, 1.20 Pre-release 5, 1.20 Pre-release 7
    • None
    • Windows 10 (20H2)
      Java embedded with the launcher (16.0.1 64bits)
      Also on Linux (see comments)
    • Community Consensus
    • Internationalisation
    • Low
    • Platform

      Context

      No-Break Space (NBSP, U+00A0) and Narrow No-Break Space (NNBSP, U+202F) are characters that are used in some language in place of regular space for typographic reasons. For instance, they are used in french, around some punctuation characters and as thousands separator in big numbers, to avoid automatic line break.

      Issue

      1. Rendering

      EDIT: The rendering issue has been fixed in 23w17a due to the update of unifont into the game. Tests performed on version 1.20-pre4 (see provided screenshots) shows that the rendering issue is fixed in regular Minecraft font and when unicode font is forced.

      2. "No-break" behaviour

      The NBSP character does not have its "no-break" behaviour when used in chat messages and other situations. Tests performed on version 1.20-pre4 (see provided screenshots) shows that :

      • The option to force unicode font does not affect the behaviour issue of (n)nbsp characters.
      • When used in /say and /tellraw in commands blocs, both characters act as intended.
      • When used in chat messages, and in /say and /tellraw directly from the chatbox, the NBSP character does not act as intended (the line-breaking behaviour still occurs)
      • In all test cases, the NNBPS act as expected.

      Possible source of the issue

      The issue with NBSP seems to come from the chat system, and not elsewhere, thus not affecting command blocks

      Before the rendering issue was fixed, NBSP character was badly rendered in the chatbox, but rendered as a space in the message when sent (with line break behaviour). This suggests that NBSP was replaced by a regular space before rendering in chat. Even after the rendering fix (23w17a), NBSP sill acting as a regular space suggets that the NBSP->space replacement still occurs (this may be related to MC-94456).

      Possible fixes

      "No-break" behaviour

      I would just suggest to not replace the NBSP character by a regular space (may cause an issue with flood/spam protection MC-94456).

        1. 2023-05-18_20.58.35.png
          2023-05-18_20.58.35.png
          576 kB
        2. 2023-05-18_20.59.15.png
          2023-05-18_20.59.15.png
          559 kB
        3. 2023-05-19_16.11.57.png
          2023-05-19_16.11.57.png
          568 kB
        4. image-2023-05-19-23-04-57-516.png
          image-2023-05-19-23-04-57-516.png
          37 kB
        5. image-2023-05-19-23-04-57-547.png
          image-2023-05-19-23-04-57-547.png
          44 kB
        6. nbsp_1.14.4.png
          nbsp_1.14.4.png
          31 kB
        7. nbsp_19w42a_no_break.png
          nbsp_19w42a_no_break.png
          46 kB
        8. nbsp_19w42a.png
          nbsp_19w42a.png
          11 kB
        9. nbsp_chat_1.20-pre4.png
          nbsp_chat_1.20-pre4.png
          26 kB
        10. nbsp_chat_forced-unicode_1.20-pre4.png
          nbsp_chat_forced-unicode_1.20-pre4.png
          74 kB
        11. NBSP_non_unicode.png
          NBSP_non_unicode.png
          522 kB
        12. nbsp_say_1.20-pre4.png
          nbsp_say_1.20-pre4.png
          44 kB
        13. nbsp_say_forced-unicode_1.20-pre4.png
          nbsp_say_forced-unicode_1.20-pre4.png
          45 kB
        14. nbsp_tellraw_1.20-pre4.png
          nbsp_tellraw_1.20-pre4.png
          32 kB
        15. nbsp_tellraw_forced-unicode_1.20-pre4.png
          nbsp_tellraw_forced-unicode_1.20-pre4.png
          40 kB
        16. NBSP_unicode.png
          NBSP_unicode.png
          553 kB
        17. nbsp-23w17a.png
          nbsp-23w17a.png
          67 kB

            Unassigned Unassigned
            marcbal Marc Baloup
            Votes:
            18 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              CHK: