Re: Displaying characters in user's locale

2014-02-01 Thread Per Bothner
On 02/01/2014 09:32 AM, Eli Zaretskii wrote: What if a sequence of bytes intended to encode ISO-8859-1 characters happens to correctly represent UTF-8 characters? This cannot happen, by virtue of the UTF-8 definition and the fact that ISO-8859-1 is a single-byte encoding. Except for ASCII cha

Re: Displaying characters in user's locale

2014-02-01 Thread Eli Zaretskii
> Date: Sat, 01 Feb 2014 19:31:14 +0200 > From: Eli Zaretskii > Cc: bug-texinfo@gnu.org, k...@freefriends.org > > > Date: Sat, 1 Feb 2014 17:07:16 + > > From: Gavin Smith > > Cc: Karl Berry , bug-texinfo@gnu.org > > > > On Sat, Feb 1, 2014 at 5:00 PM, Eli Zaretskii wrote: > > >> What if a

Re: Displaying characters in user's locale

2014-02-01 Thread Eli Zaretskii
> Date: Sat, 1 Feb 2014 17:07:16 + > From: Gavin Smith > Cc: Karl Berry , bug-texinfo@gnu.org > > On Sat, Feb 1, 2014 at 5:00 PM, Eli Zaretskii wrote: > >> What if a file is not in UTF-8 and doesn't specify its encoding? Is it > >> likely, for example, that there are many files in ISO-8859-1

Re: Displaying characters in user's locale

2014-02-01 Thread Gavin Smith
On Sat, Feb 1, 2014 at 5:00 PM, Eli Zaretskii wrote: >> What if a file is not in UTF-8 and doesn't specify its encoding? Is it >> likely, for example, that there are many files in ISO-8859-1 which >> don't specify their encoding? > > That could happen, yes. But I don't see any bad outcome for tha

Re: Displaying characters in user's locale

2014-02-01 Thread Eli Zaretskii
> Date: Sat, 1 Feb 2014 16:34:19 + > From: Gavin Smith > Cc: Karl Berry , bug-texinfo@gnu.org > > On Sat, Feb 1, 2014 at 3:50 PM, Eli Zaretskii wrote: > >> This depends on what files are out there with no encoding specified. > >> Do you know how long makeinfo has output an encoding section?

Re: Displaying characters in user's locale

2014-02-01 Thread Gavin Smith
On Sat, Feb 1, 2014 at 3:50 PM, Eli Zaretskii wrote: >> This depends on what files are out there with no encoding specified. >> Do you know how long makeinfo has output an encoding section? Is it >> still possible today that makeinfo could output a UTF-8 file with no >> encoding specified? > > It

Re: Displaying characters in user's locale

2014-02-01 Thread Gavin Smith
On Sat, Feb 1, 2014 at 8:11 AM, Eli Zaretskii wrote: > First, I think a configure time test for libiconv availability should > be added, and the code that uses libiconv should be conditioned on > HAVE_LIBICONV or some such, computed by that test. > I've managed to add the iconv module from gnulib

Re: Displaying characters in user's locale

2014-02-01 Thread Eli Zaretskii
> Date: Sat, 1 Feb 2014 15:21:51 + > From: Gavin Smith > Cc: Karl Berry , bug-texinfo@gnu.org > > > I think this function should return UTF-8 if it doesn't find any > > coding: cookies in the file. UTF-8 is probably the best default > > nowadays. > > > > This depends on what files are out t

Re: Displaying characters in user's locale

2014-02-01 Thread Gavin Smith
Thanks for the feedback. I'll work on these suggestions. Some comments - On Sat, Feb 1, 2014 at 8:11 AM, Eli Zaretskii wrote: >> +/* Look for local variables section in FB and set encoding */ >> +static void >> +set_file_lc_ctype (FILE_BUFFER *fb) > > I think this function should return UTF-8 if

Re: Displaying characters in user's locale

2014-02-01 Thread Eli Zaretskii
> Date: Fri, 31 Jan 2014 21:33:39 + > From: Gavin Smith > Cc: Karl Berry , bug-texinfo@gnu.org > > I've attached a patch which uses iconv as you suggested. I've tested > it with the two files attached under both utf-8 and iso8859-1 locales. > (I did this by, e.g. running "LANG=en_US.UTF8" to