https://bugs.llvm.org/show_bug.cgi?id=47989
Bug ID: 47989
Summary: Clang-format should use UTF-8 character's width shown
in editor rather than storage byte size.
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Formatter
Assignee: unassignedclangb...@nondot.org
Reporter: panzhongx...@126.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org
When I input some UTF-8 character rather than simple ASCII, I find that
clang-format will take the character's length as how many bytes expressed,
rather than as the length show in terminal.
For example:
`测` is stored in 3 bytes, but it takes 2 ASCII space in vim or other editors.
The expected formatted code should be as follow:
#define test \
/* 测试 */ \
"aa" \
"bb" \
"bb"
But what I really get is as follow:
#define test \
/* 测试 */ \
"aa" \
"bb" \
"bb"
I have tryed both clang-format 11.0.0 and the newest 12.0.0.
I think the width on screen should be used instead of its storage byte size.(Or
is there any configuration to control this?)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs