Letters with a diacritic are replaced by a box with question mark on paste action
Draws signalling charts, block diagrams and graphs from text input.
Brought to you by:
teknos293
Hi Zoltan,
If I copy and paste text containing letters with a diacritic (such as 'Zoltán') within the builtin editor, these letters are replaced by a box with a question mark. This also happens when the text comes from another source and is pasted in the builtin editor.
Kind regards,
Martijn
You need to select a font for the internal editor that contains the relevant glyphs. When you insert text, it may also come with formatting (including a font), which may not be available somehow.
For me it works. Do you have a specific workflow that I may try to reproduce....?
Hi Zoltan,
The letters display fine when I type them, the mangling only occurs when text like this is copied and pasted in the builtin editor.
The workflow is something like this:
Kind regards,
Martijn Schiedon
Last edit: Martijn Schiedon 2018-05-07
Hi Martin,
I still cannot reproduce. The thing you write above works for me well. What font do you have in the editor? The character 'á' BTW is part of many western european fonts - I am not sure if this is of any significance...
Zoltan
Hi Zoltan,
I've tried this with both Lucida fonts, Courier New and Consolas. With Consolas, the box with a question mark appears, with the other two fonts an empty box appears. What I noticed is that if I copy the following two letters"éé" and paste them, this results in the box with the question mark or the empty box depending on the font. If I copy "aé" this results in "a", if I copy just "é" the cursor disappears and the editor starts to wait for another keystroke before it's released again. Note that this is with both English and Dutch languages ([Win]+[Space]) and both US and US-International keyboards.
Kind regards,
Martijn
:-( It works for me well with all the fonts and characters you mention, both in Hungarian and English keyboards. What is your Windows version?
Z
Frustrating problem ;) I'm using Windows 10 Pro build 16299 (64-bit). Microsoft implemented some changes to font handling in Windows 10 (see this article), but unless the paste action changes the font used for the character, I tend to think this is more of a unicode issue where the actual bytes change when they are pasted from the clipboard. Setting the compatibility mode for Msc-generator to Windows 8 does not change the behaviour. Also, copying a text with diacritics from Msc-generator to Notepad shows the symbols correctly. But pasting the text from Notepad to Msc-generator strips the diacritical characters again.
I think you might be using CF_TEXT instead of CF_UNICODETEXT with GetClipboardData?
Maybe, maybe:-)
Related
Bugs:
#29With a debugger, I see that, on WM_PASTE, GetClipboardData is called with CF_TEXT, and returns bytes 5A 6F 6C 74 E1 6E 00 = Zoltán. Then further down the line some mfc140u functions are called (#310, #301, #12765 and #1046), but I haven't identified their purpose yet. I'm guessing that text conversion could be done there. Could it be that the 'wrong' MFC libraries are used from my Visual Studio 2017 installation?
Hey Martin,
I have finally got to this and found the bug. It will be released as 6.4.1.
Sorry it took so long.
Zoltan