[SOLVED] Copy text from LCL control to external application corrupts data lazarus / 31-LCL ---------------------------------------------------------------------- guest58172 · 2018-01-10 16:57 Let's say i have a TTreeNode.Text set to "µs". If i copy this to the clipboard and paste it in another application i get "μs" instead. I use Lazarus 1.6.4 under linux, GTK2 widgetset. Would it be an option i forgot to set  to get a properly working UTF8 LCL ? Note:  there's no problem within the same Lazarus application. It's really from LCL to 3rd part. ---------------------------------------------------------------------- guest58172 · 2018-01-10 17:10 Just added "{$CODEPAGE UTF8} " to my global inc file and no change. Seems to be for source code string literal anyway. ---------------------------------------------------------------------- Bart · 2018-01-10 18:15 I can copy from Lazarus IDE to Kate (including non-ASCII) without any problems on Linux Mint 18.2. Bart ---------------------------------------------------------------------- JuhaManninen · 2018-01-10 18:25 Quote from: BBasile on January 10, 2018, 05:57:36 pmLet's say i have a TTreeNode.Text set to "µs". If i copy this to the clipboard and paste it in another application i get "μs" instead. I use Lazarus 1.6.4 under linux, GTK2 widgetset. Would it be an option i forgot to set  to get a properly working UTF8 LCL ? No, all strings are UTF-8 by default. {$CODEPAGE UTF8} is not needed either. See:  http://wiki.lazarus.freepascal.org/Unicode_Support_in_Lazarus#String_ Literals You have added something extra into your configuration. You should update to Lazarus 1.8 although it should not make difference for this issue. ---------------------------------------------------------------------- guest58172 · 2018-01-10 18:43 I started a new simple application without settings overridden and there's also a corruption, different though. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormClick(Sender: TObject);begin  Clipboard.AsText:= 'µs';end; Then i paste in a website and get: µs. Now the more funny, when writing this answer, I've copied some code from Laz, i.e what you see above, and the literal was also wrong ! ---------------------------------------------------------------------- guest58172 · 2018-01-10 19:38 Quote from: JuhaManninen on January 10, 2018, 07:25:02 pmQuote from: BBasile on January 10, 2018, 05:57:36 pmLet's say i have a TTreeNode.Text set to "µs". If i copy this to the clipboard and paste it in another application i get "μs" instead. I use Lazarus 1.6.4 under linux, GTK2 widgetset. Would it be an option i forgot to set  to get a properly working UTF8 LCL ? No, all strings are UTF-8 by default. {$CODEPAGE UTF8} is not needed either. See:  http://wiki.lazarus.freepascal.org/Unicode_Support_in_Lazarus#String_ Literals You have added something extra into your configuration. You should update to Lazarus 1.8 although it should not make difference for this issue. I've just checked and It's fixed by Laz 1.8 but i cant use 1.8 because this version breaks many things. Actually since 1.8 RC1 i came back to 1.6.4. ---------------------------------------------------------------------- Thaddy · 2018-01-10 19:39 Yup. Same here with your example. Works now. ---------------------------------------------------------------------- guest58172 · 2018-01-10 19:47 I wonder if it was not due to the trailing null clipboard bug under GTK2...(applied in 1.6.4 but reverted in 1.8.0) BTW how can i build for GTK3 ou QT5 (compile fail during linking))? I'd like to test 1.8 before coming back to 1.6.4... ---------------------------------------------------------------------- JuhaManninen · 2018-01-10 23:02 Quote from: BBasile on January 10, 2018, 08:38:40 pmI've just checked and It's fixed by Laz 1.8 but i cant use 1.8 because this version breaks many things. Not true. You added an "alternative fact" now. Quote from: BBasile on January 10, 2018, 08:47:04 pmI wonder if it was not due to the trailing null clipboard bug under GTK2...(applied in 1.6.4 but reverted in 1.8.0) No, it was put inside   {$IFDEF GTK_REMOVE_CLIPBOARD_NULL} Just build Lazarus with the define and you are good. It was added there mainly for you. Most other people did not experience the clipboard NULL problem. Everybody however experiences a copy/paste problem between Lazarus instances when you use the define. BTW, you were informed then but somehow you forgot. ---------------------------------------------------------------------- guest58172 · 2018-01-11 01:57 Quote from: JuhaManninen on January 11, 2018, 12:02:32 amit was added there mainly for you. Most other people did not experience the clipboard NULL problem. Everybody however experiences a copy/paste problem between Lazarus instances when you use the define. Thanks much BTW. The worst being that since it was reported, fixed and finally reverted i've changed my main OS. I've setup Laz 1.8 yesterday and then this damn null trailing character is back again (unless i rebuild the LCL with the define you generously left for me). We still don't know what exactly is the real problem.