unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: Ken Raeburn <raeburn@raeburn.org>, guile-devel <guile-devel@gnu.org>
Subject: Re: fencepost error in encoding processing
Date: Sun, 15 Nov 2009 00:48:57 -0800 (PST)	[thread overview]
Message-ID: <184417.3577.qm@web37907.mail.mud.yahoo.com> (raw)
In-Reply-To: <30581C9F-01D3-4B5F-B413-EF46E1A3D365@raeburn.org>

> From: Ken Raeburn raeburn@raeburn.org

> iconv_t
> iconv_open (const char *tocode, const char *fromcode)
> {
>   /* Normalize the name.  We remove all characters beside alpha-numeric,
>     '_', '-', '/', '.', and ':'.  */
>   ...
> 
> If there's reason to believe that all these characters might show up in valid 
> encoding names, we might want to borrow that list for scm_i_scan_for_encoding 
> too.  In fact, since we don't control the iconv implementation, we should 
> probably be *at least* as lenient as glibc in accepting random characters.

You're probably right.  A rather complete set of aliases for encoding names
can be found by exploring ICU's database of aliases at
http://demo.icu-project.org/icu-bin/convexp 

Among those aliases, there are examples of the punctuation in the
iconv_open code snippet above (underscore, hyphen, forward slash, period, and colon)
as well as three others: equals sign, plus sign, and comma.  The specification
on iconv_open doesn't place any limits on the characters allowed as input to
iconv_open; however, these eight symbols above should cover any case we're likely
to see.

> 
> Okay to check in?

FWIW, it looks right to me.

-Mike Gran





  reply	other threads:[~2009-11-15  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-15  4:36 fencepost error in encoding processing Ken Raeburn
2009-11-15  8:48 ` Mike Gran [this message]
2009-11-15 22:46   ` Neil Jerram
2009-11-16  7:32     ` Mike Gran
2009-11-16 22:03       ` Richard E. Harke
2009-11-16 13:03 ` Ludovic Courtès
2009-11-16 17:25   ` Ken Raeburn
2009-11-16 21:51     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=184417.3577.qm@web37907.mail.mud.yahoo.com \
    --to=spk121@yahoo.com \
    --cc=guile-devel@gnu.org \
    --cc=raeburn@raeburn.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).