This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib: locale-sensitive lexing
On Fri, Oct 26, 2001 at 08:33:09PM +0100, Neil Booth wrote:
> Zack Weinberg wrote:-
>
> > All the users that are used to being able to get something sensible
> > out of raw diagnostic output dumped to a terminal will just *love*
> > this idea.
>
> Well, it would be the same they get now for most charsets at least,
> but point taken.
And on the other hand, sometime last year the editor folks at Apple
asked me if it would be possible to get a mode where gcc printed the
absolute byte offset in the file...
> > 2. If we require all files which contain non-ASCII codes to be marked
> > in band (which I am in favor of), then converting the entire file on
> > load should be acceptably fast.
>
> Well, non-basic charset rather than ASCII. ASCII control codes SI and
> SO (shift-in and shift-out) are used as shifts in SJIS I believe.
Sorry, yes, non-basic charset is what I meant.
> So, suppose we adopt approach 1. for the moment (and possibly do
> something for the others later). How can we portably get the correct
> text string for iconv from the user's locale, or can't we? (I assume
> you would have UTF-8 as the destination charset). Or if we can't
> guarantee that, can we get something that would work for most systems
> most of the time?
_nl_langinfo(CODESET) or words to that effect. Check how the Java
front end does it.
zw