[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] [PATCH] Add a few useful aliases
From: |
Bruno Haible |
Subject: |
Re: [bug-gnu-libiconv] [PATCH] Add a few useful aliases |
Date: |
Tue, 8 Apr 2008 00:54:39 +0200 |
User-agent: |
KMail/1.5.4 |
> I am concerned here with iconv-the-program, not iconv-the-function-call. Is
> there a way to add aliases that are visible only in the former case?
You can write a wrapper script around the iconv program that supports the
options that you want.
I find it more promising to write a wrapper around iconv that supports
the standard encoding names, even on systems that don't know about these
standard names. Like here (with the iconv_open function):
http://www.gnu.org/software/gnulib/MODULES.html#module%3Diconv_open
> for the command-line tool not to
> recognize e.g. "utf8" when other well-established implementations do shows
> a rather troubling emphasis of pedantry over interoperability.
If you are after interoperability, you should look at the standards. In the
case of character set names, it's the IANA list.
People who write "utf8" usually don't do this because they care for
interoperability. They do it out of sloppiness, or because they don't know
about the standards.
- If you allow sloppiness here, where do you stop? People have trouble
memoizing "8859", so should iconv also support "iso-8559-1"? Do you do
fuzzy matching?
- End users should not need to know about the standards, but programmers
should. If you have a GUI (menu / combobox) for example, show the user
a combination of standard name and explanation, like:
ISO-8859-15 (Western with EURO)
UTF-8 (Unicode)
> My employer makes use of files named e.g. "en.utf8.dic.txt",
> "en.iso8859-1.dic.txt".
He could also have chosen to prefer even smaller file names, e.g.
"en.u8.dic.txt" and "en.l1.dic.txt". That would not be a good reason for
asking that iconv must support the names "u8" and "l1".
> The toolchain I referred to above uses GNU Make, and with pattern rules,
Dashes are supported in pattern rules. This works without problems:
%.utf-8.txt : %.iso-8859-1.txt
iconv -f iso-8859-1 -t utf-8 < $< > $@
Bruno