Skip to content
Commit 92c5eed5 authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Kurt Hindenburg
Browse files

Avoid constructing QChar from non-BMP codepoints

This is fallout from use of UTF-16. While konsole uses an internal 32
bit character type since 5128781a in 2018, there were still scattered
places where QChar (which is 16 bit) was constructed from our internal
32 bit character, potentially causing mojibake or other confusion on Qt5
due to truncation to 16 bits, and assert failures on Qt6.

As an example of confusion on Qt5 before this commit, with "Trim
trailing spaces" enabled, run the following, and try to select and copy
the horse pictogram:

printf "Hey, horse, don't run away from me:\U10085\n"

U+10085 gets confused with U+0085, which is a space character (NEXT
LINE). You'll never catch the horse (don't fret, Achilles had the same
problem with a tortoise).

See https://softwareengineering.stackexchange.com/questions/102205/should-utf-16-be-considered-harmful

(cherry picked from commit d5903c47)
parent fad6f15f
Pipeline #639058 passed with stages
in 11 minutes and 58 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment