From: dududuil on 28 Apr 2010 05:24 hi, I have an application that manipulates strings. Its compiled without _UNICODE. I'm trying to do: mySrt.Remove('\r'); My problem is that although all \r are removed correctly, some characters are beening changed as well !! I don't read JP, but its clear that some letters had been change after this \r removal What is going on here? please help.
From: Tom Serface on 28 Apr 2010 07:43 If you are doing Unicode you should use _T('\r') to make it a TCHAR. You could also use L'\r' to force Unicode. Tom "dududuil" <dududuil(a)discussions.microsoft.com> wrote in message news:932E6845-41B7-4EB7-A118-5FE08C7E918D(a)microsoft.com... > hi, > I have an application that manipulates strings. > Its compiled without _UNICODE. > > I'm trying to do: > mySrt.Remove('\r'); > > My problem is that although all \r are removed correctly, some characters > are beening changed as well !! > I don't read JP, but its clear that some letters had been change after > this > \r removal > > What is going on here? please help.
From: Ulrich Eckhardt on 28 Apr 2010 08:02 dududuil wrote: > I have an application that manipulates strings. > Its compiled without _UNICODE. > > I'm trying to do: > mySrt.Remove('\r'); > > My problem is that although all \r are removed correctly, some characters > are beening changed as well !! How about an example? > I don't read JP, but its clear that some letters had been change after > this \r removal What is JP? > What is going on here? What does all that have to do with Unicode strings? Uli -- C++ FAQ: http://parashift.com/c++-faq-lite Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
From: dududuil on 28 Apr 2010 08:35 My Application is compiled without _UNICODE - so _T() is ignored, and L'\r' will shrink back to '\r' when calling the Remove
From: Jochen Kalmbach [MVP] on 28 Apr 2010 08:40 Hi dududuil! > I'm trying to do: > mySrt.Remove('\r'); > > My problem is that although all \r are removed correctly, some characters > are beening changed as well !! > I don't read JP, but its clear that some letters had been change after this > \r removal > > What is going on here? please help. I think, your encoding does not match your settings / current locale. Maybe you are using UTF8 in the string but the CRT/MFC locale is "C". So the UTF8-Multibyte characters will also treated as "normal" chars and therefor it will remove any '\r' (0x0d) in the multibyte character. -- Greetings Jochen My blog about Win32 and .NET http://blog.kalmbachnet.de/
|
Next
|
Last
Pages: 1 2 3 Prev: Performance of CString::Replace Next: automatic refreshing of data in vb6.0 |