Re: [AD] unicode proposal

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Wed, 2009-01-21 at 11:59 -0700, Thomas Fjellstrom wrote:
> >
> > Hm, not sure I follow.. it would be required in Windows, as you could
> > not display the filenames otherwise.
> 
> I'm not so sure thats the only time. Linux doesn't much care what encoding the 
> filenames actually are. And its rather hard to detect properly (if its possible 
> at all), see http://search.cpan.org/search?query=Encode%3A%3AGuess&mode=all 
> for some code that attempts it, and does a somewhat reasonable job.. I once 
> used that module to mostly convert some music tags automatically to utf8 from 
> whatever they happened to be (a mix of asian scripts).
> 
> the problem then, is converting "sjis" to utf8 without knowing it's sjis will 
> corrupt the string beyond recognition.

Yeah. My hope was that this is quite uncommon - so we'd live with the
fact that on a very small percentage on Unixes filenames would appear
garbled when passed to al_textprintf - but applications still would keep
working correctly.

> >
> > Well, I feel things get a lot simpler if we get rid of all the "current
> > encoding" semantics and just say our whole API is UTF-8. That's the
> > whole point of this thread :)
> 
> Yes indeed. But it doesn't really make it simpler. The code still has to 
> support UCS2 (or whatver windows is in), and UTF8.
> 

Yes, that's the one case where we still would have to convert, but it's
a simple 1:1 conversion, without any tables or anything, just 2 or 3
lines of code. And it always would work reliably without any exceptions,
including passing filenames to al_textprintf.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/