[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] [Patch] TMerge Unicode build

From: Norbert Unterberg <nepo_at_gmx.net>
Date: 2005-04-17 14:01:31 CEST

Well, this is patch day, sorry...

> I must have introduced a new bug (or uncovered an old one) with that
> patch. If you diff and modify UTF-8 files that do not have a BOM (like
> the Tortoise *.po language files), some of the special characters are
> still destroyed.

Attached patch fixes that problem (a workaround, in a way I am not proud
of). Next time I should wait a few days before submitting a patch :-(

Norbert

Index: TortoiseMerge/FileTextLines.cpp
===================================================================
--- TortoiseMerge/FileTextLines.cpp (revision 3062)
+++ TortoiseMerge/FileTextLines.cpp (working copy)
@@ -331,7 +331,16 @@
                 {
                         for (int i=0; i< GetCount(); i++)
                         {
- CStringA sLine = CStringA(GetAt(i));
+ // Copy CString to 8 bit wihout conversion
+ CStringA sLine;
+ CString sLineT = GetAt(i);
+
+ char *pszLine = sLine.GetBuffer(sLineT.GetLength());
+ for (int l = 0; l < sLineT.GetLength(); ++l)
+ *pszLine++ = LOBYTE(sLineT[l]);
+ *pszLine = 0;
+ sLine.ReleaseBuffer();
+
                                 if (bIgnoreWhitespaces)
                                 {
                                         StripAsciiWhiteSpace(sLine);

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Sun Apr 17 14:02:03 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.