# Re: GIT character codecs

2 messages from 2005-11-14 to 2005-11-14. Participants: Marco Costalba, Matthias Urlichs.
Thread: https://gitlist.dev/t/2492

## Marco Costalba, 2005-11-14 06:31

Subject: Re: GIT character codecs
Message-ID: <20051114063126.27817.qmail@web26306.mail.ukl.yahoo.com>
URL: https://gitlist.dev/e/20051114063126.27817.qmail%40web26306.mail.ukl.yahoo.com

```
Matthias Urlichs wrote:

>Hi, Junio C Hamano wrote:
>
>>I suspect you could just take the default from LANG and LC_CTYPE
>>to cover 98% of the cases, and to cover the rest 2% the
>>problematic cases have a per-window override menu.
>
>
>Or, if you want to be super-flexible, just try to decode as UTF-8.
>Success? fine -- otherwise use whatever your application's default is
>set to, or your local encoding (which may of course also be UTF-8), or
>fall back to 8859-15.
>

How it is possible to test for success?

The codec could see everything decodable, but It's only from the context,
i.e. the user who reads, that it is possible to realize it's the wrong codec.  

Anyhow, as I posted previous in this thread, qgit-0.97.2 now has a codec selector
 as a persistent setting, defaulting to local codec.


  Marco



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

```

## Matthias Urlichs, 2005-11-14 07:42

Subject: Re: GIT character codecs
Message-ID: <20051114074246.GP27727@kiste.smurf.noris.de>
URL: https://gitlist.dev/e/20051114074246.GP27727%40kiste.smurf.noris.de
In-Reply-To: <20051114063126.27817.qmail@web26306.mail.ukl.yahoo.com>

```
Hi,

Marco Costalba:
> >Or, if you want to be super-flexible, just try to decode as UTF-8.
> >Success? fine -- otherwise use whatever your application's default is
> >set to, or your local encoding (which may of course also be UTF-8), or
> >fall back to 8859-15.
> 
> How it is possible to test for success?

UTF-8 decoding does NOT always succeed.

In fact, there is no other 8-bit encoding which decodes as valid UTF-8,
given real-world text.

> The codec could see everything decodable, but It's only from the
> context, i.e. the user who reads, that it is possible to realize it's
> the wrong codec.  
> 
True in general, but not with UTF-8 (or ASCII, for that matter ;-).

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
You can fool the people about many things, but only a fool would be foolish
enough to fool the people about money.
					-- Italo Bombolini

```
