Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » [Proposal] The maintainer and the future of TURTLE package
Re: [Proposal] The maintainer and the future of TURTLE package [message #54652 is a reply to message #54491] Wed, 26 August 2020 17:12 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Hello Mirek,

I have ancountered a curious problem while testing the Turtle/VirtualGui port.
(Note: This is tested on a Linux machine with default LANG=UTF-8 encoding. and this problem affects both old and new Turtle packages as the VirtualGui package shares the same clipboard code.)

The problem is GetWString and GetString do not work properly if called on a clipboard text.

TextCtrl derived classes are affected by this, as they use the same mechanism.

Sreenshot with explanation:

index.php?t=getfile&id=6168&private=0

Now, the culprit seems to be the VirtualGui clipboard String/WString conversion code (VirtualGui/Clip.cpp, 64-86):

String GetString(PasteClip& clip)
{
	GuiLock __;
	if(clip.Accept("wtext")) {
		String s = ~clip;
		return WString((const wchar *)~s, wstrlen((const wchar *)~s)).ToString(); / << Adds random chars. Why is this though? It is already a string. For charset conversion?

            //  return ToUtf16(s).ToString();    // Seems to work fine...
            //  return s.ToWString().ToString(); // Seems to work fine...
 
	}
	if(clip.IsAvailable("text"))
		return ~clip;
	return Null;
}

WString GetWString(PasteClip& clip)
{
	GuiLock __;
	if(clip.Accept("wtext")) {
		String s = ~clip;
		return WString((const wchar *)~s, wstrlen((const wchar *)~s)); // Adds random chars...

            //  return ToUtf16(s);    // Seems to work fine...
            //  return s.ToWString(); // Seems to work fine...

	}
	if(clip.IsAvailable("text"))
		return (~clip).ToWString();
	return Null;
}



Best regards,
Oblivion


[Updated on: Wed, 26 August 2020 17:18]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Want to use CLANG with MSBT64 toolchain
Next Topic: UppHub and version managment
Goto Forum:
  


Current Time: Mon Apr 29 12:39:29 CEST 2024

Total time taken to generate the page: 0.03047 seconds