Recent

Author Topic: Problem with pasting text/utf8 in DoubleCmd's internal editor  (Read 1607 times)

artist

  • Newbie
  • Posts: 4
Problem with pasting text/utf8 in DoubleCmd's internal editor
« on: September 08, 2024, 09:34:20 pm »
Problem with pasting text/utf8 in DoubleCmd's internal editor.

It is impossible to paste text from Terminology (EFL based terminal emulator, standard in the Enlightenment and Moksha Desktop Environments) - nothing appears/happens in DoubleCmd's internal editor.
Pasting text from Terminology into any other application/editor, eg. Leafpad, works fine.

Terminology version: 1.13.1 but also earlier.
Doublecmd version is 1.1.7.

A similar problem was reported in the past for editor Featherpad https://github.com/tsujan/FeatherPad/issues/699 which was fixed by a change.
Hopefully a similar change can be created for DoubleCmd.

sfeinst

  • Full Member
  • ***
  • Posts: 235
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #1 on: September 08, 2024, 10:10:00 pm »
I don't want to assume, but if you're asking about Double Commander, it has an issues forum on github at:
https://github.com/doublecmd/doublecmd/issues

You could ask there or post the bug.

artist

  • Newbie
  • Posts: 4
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #2 on: September 08, 2024, 10:16:00 pm »
This is indeed in Double Commander, but its internal editor is SynEdit based.

zeljko

  • Hero Member
  • *****
  • Posts: 1653
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #3 on: September 09, 2024, 08:13:05 am »
Seem that Terminology does not set correct mime types, I need a list of mimetypes when you try to paste that data.

AlexTP

  • Hero Member
  • *****
  • Posts: 2475
    • UVviewsoft
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #4 on: September 09, 2024, 08:59:15 am »
List of mime types is set by Qt5 widgetset, not by DoubleCmd. Terminology sets the mime type as shown in the https://github.com/tsujan/FeatherPad/issues/699

>>Under X11, Terminology gives text/plain;charset=utf-8 as the MiIME type (or, at least, Qt sees it as such)

d2010

  • Jr. Member
  • **
  • Posts: 59
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #5 on: September 09, 2024, 09:06:28 am »
Seem that Terminology does not set correct mime types, I need a list of mimetypes when you try to paste that data.
Can you see how to downloading DC.exe? not source? Maby a install kitt of DC?
Eg.1 I search with google(do)com, but the last version?


AlexTP

  • Hero Member
  • *****
  • Posts: 2475
    • UVviewsoft

LV

  • Full Member
  • ***
  • Posts: 134
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #7 on: September 09, 2024, 06:56:55 pm »
This is indeed in Double Commander, but its internal editor is SynEdit based.

I'm having the same issue. When I try to insert math symbols in comments in the Lazarus IDE (version 2.2.6 on Windows 11), things can get a bit tricky.  Check out the screenshot below. The same thing happens when using the TSynEdit component in my app.


LV

  • Full Member
  • ***
  • Posts: 134
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #8 on: September 09, 2024, 08:46:58 pm »
Inserting math UTF-8 symbols in the TMemo box (unlike the TSynEdit box) seems to be working fine.  ;)

paweld

  • Hero Member
  • *****
  • Posts: 1250
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #9 on: September 10, 2024, 06:22:36 am »
@LV - it just depends on the font, whether it has glyphs that support the given characters. See attachment
Best regards / Pozdrawiam
paweld

LV

  • Full Member
  • ***
  • Posts: 134
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #10 on: September 10, 2024, 05:43:15 pm »
@Paweld, thanks! I've attached a simple test project (Project1.zip). It's got a form with Memo1 and SynEdit1 on it. The Consolas font's used everywhere. I've entered two lines of text, a ∈ A and b ∉ A, and they display fine in the Memo1 field, but not in SynEdit1 or the IDE Lazarus source editor (2024-09-10 174645.png). What am I missing here?
Best regard, LV

Updated: Thanks/Podziękowanie again to Paweld, the problem is sorted!
« Last Edit: September 10, 2024, 07:50:46 pm by LV »

artist

  • Newbie
  • Posts: 4
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #11 on: September 11, 2024, 11:55:02 am »
The problem that was reported originally here still remains.

zeljko

  • Hero Member
  • *****
  • Posts: 1653
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #12 on: September 11, 2024, 12:02:08 pm »
@Paweld, thanks! I've attached a simple test project (Project1.zip). It's got a form with Memo1 and SynEdit1 on it. The Consolas font's used everywhere. I've entered two lines of text, a ∈ A and b ∉ A, and they display fine in the Memo1 field, but not in SynEdit1 or the IDE Lazarus source editor (2024-09-10 174645.png). What am I missing here?
Best regard, LV

Updated: Thanks/Podziękowanie again to Paweld, the problem is sorted!

It works ok here. Lazarus trunk Qt5 on LinuxMint 20.3.

AlexTP

  • Hero Member
  • *****
  • Posts: 2475
    • UVviewsoft
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #13 on: September 11, 2024, 12:36:41 pm »
I added Writeln(WStr) here in qt5 file lcl/interfaces/qt5/qtobjects.pas

Code: Pascal  [Select][+][-]
  1.   if (MimeType = 'text/plain') then // do not translate
  2.   begin
  3.     QGuiApplication_platformName(@WStr);
  4.     Writeln('WStr', WStr);
  5.  

it shows 'xcb'.
so I did this small change: added
Code: Pascal  [Select][+][-]
  1. if (WStr = 'xcb') or

here:

Code: Pascal  [Select][+][-]
  1.   //issue #40423
  2.   if (MimeType = 'text/plain') then // do not translate
  3.   begin
  4.     QGuiApplication_platformName(@WStr);
  5.     if (WStr = 'xcb') or (CompareText(Copy(UTF16ToUTF8(WStr), 1, 7),'wayland') = 0) then  // do not translate
  6.     begin
  7.  

then paste works as before (from CudaText to CudaText) and from Terminology to CudaText too!
Zeljko, I don't know what I did. Maybe I added support for MIME type "text/plain;charset=utf8" to X11 too?
But it works now.

zeljko

  • Hero Member
  • *****
  • Posts: 1653
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Problem with pasting text/utf8 in DoubleCmd's internal editor
« Reply #14 on: September 11, 2024, 12:42:26 pm »
You just added wayland platform to execute same code as xcb. WStr should be wayland all the time, so no need to use CompareText()

 

TinyPortal © 2005-2018