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 » U++ Library support » U++ Core » Problem and fix in LocalProcess
Problem and fix in LocalProcess [message #28550] Mon, 06 September 2010 17:44 Go to next message
koldo is currently offline  koldo
Messages: 3358
Registered: August 2008
Senior Veteran
Hello Mirek

Now LocalProcess::Read(String& res) function in Windows includes this in LocalProcess.cpp line 341:

	res.Cat(buffer, n);

It should be replaced with this:

	res.Cat(FromSystemCharset(buffer), n);


This way accents and other chars are not lost.


Best regards
Iñaki
Re: Problem and fix in LocalProcess [message #28558 is a reply to message #28550] Tue, 07 September 2010 05:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Mon, 06 September 2010 11:44

Hello Mirek

Now LocalProcess::Read(String& res) function in Windows includes this in LocalProcess.cpp line 341:

	res.Cat(buffer, n);

It should be replaced with this:

	res.Cat(FromSystemCharset(buffer), n);


This way accents and other chars are not lost.


Should not it rather be

res = FromSystemCharset(String(buffer, n)))

?!

Frankly, we are perhaps missing FromSystemCharser(const char *, int count) variant here, I guess...
Re: Problem and fix in LocalProcess [message #28560 is a reply to message #28558] Tue, 07 September 2010 08:42 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3358
Registered: August 2008
Senior Veteran
luzr wrote on Tue, 07 September 2010 05:33

koldo wrote on Mon, 06 September 2010 11:44

Hello Mirek

Now LocalProcess::Read(String& res) function in Windows includes this in LocalProcess.cpp line 341:

	res.Cat(buffer, n);

It should be replaced with this:

	res.Cat(FromSystemCharset(buffer), n);


This way accents and other chars are not lost.


Should not it rather be

res = FromSystemCharset(String(buffer, n)))

?!

Frankly, we are perhaps missing FromSystemCharser(const char *, int count) variant here, I guess...

Hello Mirek

For me Cat was good but really you have a finer grain view.

However you are right. It seems FromSystemCharser(const char *, int count) would be the best option.


Best regards
Iñaki
Re: Problem and fix in LocalProcess [message #28575 is a reply to message #28558] Tue, 07 September 2010 18:06 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
luzr wrote on Mon, 06 September 2010 23:33



res = FromSystemCharset(String(buffer, n)))



Whatever, for now, I have fixed it with code above...
Previous Topic: Problem and fix in HexString
Next Topic: DLI doc fix
Goto Forum:
  


Current Time: Mon Apr 29 15:19:30 CEST 2024

Total time taken to generate the page: 0.02550 seconds