Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6086

Unicode/UTF-8 in the shell needs to handle zero-width and double-width characters

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.5
    • Affects Version/s: 2.1.1
    • Component/s: Shell
    • None
    • ALL
    • Server 2.7.5

      Combining characters in Unicode are composed of two adjacent Unicode code units but occupy a single position on the screen. The second code unit of these pairs needs to be treated as a zero-width character so that cursor positioning matches displayed text properly.

      Chinese, Japanese and Korean (CJK) characters will typically occupy two screen positions although they are encoded as a single Unicode code unit. These characters need to be treated as double-width characters so that cursor position matches displayed text properly.

      To reproduce:

      Open mongo shell.
      Insert multi-byte sequence as a find document such as:

      > db.item.find({'type':"한글블라블라블라"})

      Move the cursor to a few characters before the terminating quotation and hit backspace.

      The terminating quotation will disappear.

            benety.goh@mongodb.com Benety Goh
            tad Tad Marshall
            1 Vote for this issue
            7 Start watching this issue