Hello, Stefan!
> Strange. I can't reproduce this here. Maybe because your files are in
> your own codepage (not utf8 or utf16) which I don't have here.
>
> But I've tried with test files in my own codepage which have some
> non-ASCII chars. And I can edit those lines and save/reload without
> loosing them.
>
> Maybe someone which has your codepage can reproduce and fix this?
Just to remind the problem: I have non-English Windows XP installed and
set English formats in Regional Options. After that, TMerge started to
spoil non-English text upon saving - it replaced every Russian character
with a question mark.
I've investigated the problem.
The bad thing happens in FileTextLines.cpp in these two lines:
CString sLineT = GetAt(i);
CStringA sLine = CStringA(sLineT);
In the second line of code, MultiByteToWideChar() is called with first
argument set to CP_THREAD_ACP. And since the thread locale is set to
something different than the default system locale, conversion goes
wrong.
There are basically two ways to solve the problem:
First is to rewrite the code to do the conversion ourselves, and call
MultiByteToWideChar(CP_ACP, ...).
And second is to set the thread locale to the same value as the default
system locale is.
The attached patch does it in the second way.
Sincerely yours,
Ivan Gerasimov
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=1016492
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-01-11 05:50:03 CET