From: Mikhail Zabaluev <mhz@alt-linux.org>
To: mandrake-russian@altlinux.ru
Subject: [mdk-re] Re: XML parser encodings
Date: Thu Nov 15 02:48:00 2001
Message-ID: <20011114235900.GL1995@localhost.localdomain> (raw)
In-Reply-To: <20011113210555.4db73470.vsu@mivlgu.murom.ru>
Hello Sergey,
On Tue, Nov 13, 2001 at 09:05:55PM +0300, Sergey Vlasov wrote:
>
> > > Да, кстати, а как сказать iconv, чтобы он не ругался на некоторые символы,
> > > встречающиеся в текстах как "В данной кодировке таких символов нетути!" а
> > > чтоб он его просто пропускал, и топал дальше текст жевать?
> > Если речь идет об утилите командной строки, то ключик --replace=SYMBOL,
> > если о функции, то смотрите исходники утилиты командной строки.
>
> В эти исходники я заглядывал - лучше не смотреть, там все жестко
> привязано к реализации iconv() в glibc (используются внутренние
> структуры, даже не описанные в устанавливаемых файлах
> заголовков). Оно и понятно - iconv --list вообще невозможно
> реализовать стандартными средствами, не зависящими от реализации
> iconv().
>
> Лучше посмотреть на реализацию функции g_convert_with_fallback()
> в GLib-1.3.x (pre-2.0) - там переносимая реализация. Основной
> принцип - при ошибке преобразования исходная строка
> преобразуется в UTF-8 (что должно пройти в любом случае), а
> затем производится посимвольное преобразование из UTF-8 в
> требуемую кодировку, с заменой символов, которые не удается
> преобразовать.
Сие грамотно, разве что так тщательно нужно перекодировать только то
место, где iconv спотыкается -- ведь функция сама двигает указатели,
пока все OK.
--
Stay tuned,
MhZ JID: mookid@jabber.org
___________
After all, all he did was string together a lot of old, well-known quotations.
-- H.L. Mencken, on Shakespeare
next prev parent reply other threads:[~2001-11-15 2:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-12 8:05 ` Oleg A. Paraschenko
2001-11-12 12:39 ` Alexander Bokovoy
2001-11-13 1:40 ` Mikhail Zabaluev
2001-11-13 12:48 ` Alexander Bokovoy
2001-11-13 20:30 ` Alexei Takaseev
2001-11-13 20:38 ` Alexander Bokovoy
2001-11-13 20:47 ` [mdk-re] iconv -r ôÕÒÂÉÎ áÌÅËÓÅÊ
2001-11-13 20:49 ` [mdk-re] Re: XML parser encodings Sergey Vlasov
2001-11-13 21:00 ` Alexander Bokovoy
2001-11-15 2:48 ` Mikhail Zabaluev [this message]
2001-11-15 17:37 ` Sergey Vlasov
2001-11-16 12:27 ` Mikhail Zabaluev
2001-11-16 12:51 ` Mikhail Zabaluev
2001-11-13 20:50 ` Aleksey Novodvorsky
2001-11-13 21:06 ` Dmitry V. Levin
2001-11-13 21:23 ` John Profic
2001-11-14 7:02 ` Yura Gusev
2001-11-15 2:50 ` Mikhail Zabaluev
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011114235900.GL1995@localhost.localdomain \
--to=mhz@alt-linux.org \
--cc=mandrake-russian@altlinux.ru \
/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
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git