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

Re: BUG: TortoiseMerge automatically converts ANSI file to UTF8 w/o BOM

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Thu, 11 Sep 2008 22:27:56 +0200

Simon Large wrote:
> 2008/9/11 Stefan Küng <tortoisesvn_at_gmail.com>:
>> debose wrote:
>>> On Sep 9, 9:27 pm, Stefan Küng <tortoise..._at_gmail.com> wrote:
>>>> Sure, it you have utf8 encoded text, then the file is utf8 encoded.
>>> Seems like that build, incorrectly detects UTF8 w/o BOM. F.e. every
>>> file that contains ONLY ASCII(plain English, without locale-dependent
>>> symbols) is treated in TortoiseMerge as UTF8 CRLF, while in fact it is
>>> ANSI.
>>> And after editing in TortoiseMerge, it will become UTF8, which is not
>>> acceptable for me. =(
>> I added a registry key to set the default:
>> HKCU\Software\TortoiseMerge\UseUTF8
>> (DWORD value)
>>
>> if set to 1, then TortoiseMerge will default to utf8 when loading files
>> which only have chars < 127 in it.
>
> The code looks different from this description. It appears that it
> will use UTF8 in the following conditions:
> a) if there is already a UTF8 BOM, or
> b) if there are non-ascii chars AND the UseUTF8 key is non-zero.
>
> The UseUTF8 key defaults to 0, so by default there is no conversion.

As I said: if the registry key is set to 1 (UseUTF8 is 1, not the
default 0), then an ANSI file which only has chars < 127 is treated as
utf8 (if there are no chars > 127, then the encoding can be either ANSI
or utf8 - it's the same).
But that registry key is of course only used if the automatic encoding
detection isn't able to detect the encoding automatically.

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net

Received on 2008-09-11 22:28:11 CEST

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