'…' ellipsis character is garbled under MSVC - #20755
Conversation
Hmm? The file displays correctly in VS Code. I don't think this is the right solution. |
|
It's not about displaying the source code. I suppose if you run the portion of the test in vim compiled by MSVC, you should also see garbage when virtual text is trimmed with ellipsis. Maybe MSVC needs some flag to treat source files as utf-8, I am not really sure. |
|
Does this solve the issue (without changing "…" to "\342\200\246")? --- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -537,7 +537,7 @@ CFLAGS = -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DHAVE_STDINT_H \
$(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) \
$(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) $(CHANNEL_DEFS) \
$(DEFINES) $(CI_CFLAGS) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
- /source-charset:utf-8
+ /utf-8
RCFLAGS = -DVIM_VERSION_PATCHLEVEL=$(PATCHLEVEL)
Currently, |
Problem: Source code is not treated as utf-8 by MSVC, so '…'
character in string literal is interpreted wrong.
Solution: Set utf-8 for both source and execution charsets.
8c2698b to
3d6dff4
Compare
Thank you for the fix, at least CI passes. |
|
Thanks. Let me include it. Since CI is green I hope it won't cause any issues for Windows users. |
Example of breakage https://github.com/noscript/vim/actions/runs/29205020293/attempts/1:
where
"…"is not interpreted properly and its byte length is also wrong, causing garbage in rendering.The problem is probably bigger than the fix addresses, but I don't have Windows environment and have no opportunity to experiment.