https://bugs.kde.org/show_bug.cgi?id=415410
Bug ID: 415410 Summary: bad display of string values containing Unicode supplemental characters Product: kdevelop Version: 5.4.2 Platform: Ubuntu Packages OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: CPP Debugger Assignee: kdevelop-bugs-n...@kde.org Reporter: andy.henin...@gmail.com CC: niko.s...@gmail.com Target Milestone: --- SUMMARY The C++ debugger display of string values is garbled when the string contains Unicode supplemental characters, that is, character code points > 64k STEPS TO REPRODUCE 1. Debug the following test program. The emoji 😎 is Unicode U+1F60E. ========= #include <iostream> int main() { const char *cs8 {"Hello, Worldβ😎.\n"}; const char16_t *cs16 {u"Hello, Worldβ😎.\n"}; const char32_t *cs32 {U"Hello, Worldβ😎.\n"}; std::cout << cs8 << std::endl; } ========== 2. Put a break point on the std::cout line. 3. Examine the local variables in the variables debug window OBSERVED RESULT cs8 0x4d9ca0 <str> "Hello, Worldβ�\237\230\216.\n" cs16 0x4d9ce0 <str> u"Hello, Worldβ�\237\230\216.\n" cs32 0x4d9d40 <str> U"Hello, Worldβ�\237\230\216.\n" EXPECTED RESULT cs8 0x4d9ca0 <str> "Hello, Worldβ😎.\n" cs16 0x4d9ce0 <str> u"Hello, Worldβ😎.\n" cs32 0x4d9d40 <str> U"Hello, Worldβ😎.\n" SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 19.10 (available in About System) KDE Plasma Version: 5.16.5 KDE Frameworks Version: 5.62.0 Qt Version: 5.12.4 ADDITIONAL INFORMATION Raw gdb, run from the command line, works correctly. (gdb) b 8 Breakpoint 1 at 0x11d6: file suppl.cpp, line 8. (gdb) r Starting program: /home/andy/icprogs/a.out Breakpoint 1, main () at suppl.cpp:8 8 std::cout << cs8 << std::endl; (gdb) p cs8 $1 = 0x555555556009 "Hello, Worldβ😎.\n" (gdb) p cs16 $2 = 0x555555556020 u"Hello, Worldβ😎.\n" (gdb) p cs32 $3 = 0x555555556048 U"Hello, Worldβ😎.\n" -- You are receiving this mail because: You are watching all bug changes.