Re: Source code encoding detection modifications for intltool



El mar, 15-07-2003 a las 12:54, Abel Cheung escribió:
> On 2003-07-14(Mon) 20:34:18 +0200, Carlos Perelló Marín wrote:
> > Hi, here you have a patch that tries to detect the file encoding used
> > and then, calls xgettext with that encoding option.
> 
> An unexpected failure -- currently escaped hex values (\x??) are not
> handled. Source code with such strings should most likely use
> --from-code=UTF-8 too, but "file" detects them as either ASCII or ISO-*
> files. (mlview/src/mlview-app.c for example)

Well, if it's detected as an ASCII file, we can use without problems the
UTF-8 encoding, the problem is if it detects it as an ISO-* because
there are characters that are not valid UTF-8 characters...

> 
> It's not easy to determine what encoding is represented by escaped hex
> values -- it can be UTF-8, or can be something else, though it's most
> likely UTF-8 in GNOME 2.x software.

Ideas to "fix" it?

Assume that all files are using UTF-8 is not the correct behavior...

Cheers.

> 
> Abel
> 
> > Please, test it and review it I have no idea about perl so my change
> > it's mainly a cut & paste fix
> > 
> > I will also prepare a gettext >= 0.12 check so new intltool releases
> > will require it to be able to deal with UTF-8 source files.
> > 
> > Some comments. I get the file encoding with the "file" command and thus,
> > I'm not able to know  the XML and yacc files encoding, so I'm assuming
> > that XML files are UTF-8 and any other file that it's not UTF-8, ISO* or
> > XML is ASCII
> > 
> > Comments, ideas?
> > 
> > I will apply this patch to my intltool installation so the status pages
> > will start to use it.
-- 
Carlos Perelló Marín
Debian GNU/Linux Sid (PowerPC)
Linux Registered User #121232
mailto:carlos pemas net || mailto:carlos gnome org
http://carlos.pemas.net
Valencia - Spain

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]