Menu ▾ ▴

#29 Letters with a diacritic are replaced by a box with question mark on paste action

v6.x
closed
None
5
2021-06-24
2018-05-01
No

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

Related

Bugs: #29

Discussion

  • Zoltán Turányi

    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....?

     
  • Martijn Schiedon

    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:

    • Start a new Msc-generator instance (select "Block Diagram" when asked for a chart type)
    • Replace any existing text with the word "Zoltán"
    • Select all text ([Ctrl]+[A])
    • Copy text ([Ctrl]+[C])
    • Paste text ([Ctrl]+[V])

    Kind regards,
    Martijn Schiedon

     

    Last edit: Martijn Schiedon 2018-05-07
    • Zoltán Turányi

      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

       
  • Martijn Schiedon

    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

     
    • Zoltán Turányi

      :-( 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

       
  • Martijn Schiedon

    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.

     
  • Martijn Schiedon

    I think you might be using CF_TEXT instead of CF_UNICODETEXT with GetClipboardData?

     
    • Zoltán Turányi

      Maybe, maybe:-)

      On 2018. May 22., at 9:54, Martijn Schiedon mschiedon@users.sourceforge.net wrote:

      I think you might be using CF_TEXT instead of CF_UNICODETEXT with GetClipboardData?

      [bugs:#29] Letters with a diacritic are replaced by a box with question mark on paste action

      Status: open
      Group: v6.x
      Created: Tue May 01, 2018 01:57 PM UTC by Martijn Schiedon
      Last Updated: Tue May 22, 2018 07:27 AM UTC
      Owner: Zoltán Turányi

      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

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/msc-generator/bugs/29/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #29

  • Martijn Schiedon

    With 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?

     
    • Zoltán Turányi

      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

       
  • Zoltán Turányi

    • status: open --> closed