bug-libunistring
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-libunistring] Changing the appearance of escapes


From: Bruno Haible
Subject: Re: [bug-libunistring] Changing the appearance of escapes
Date: Sat, 18 Sep 2010 19:19:54 +0200
User-agent: KMail/1.9.9

Mike,

> if I understand correctly, you can make a copy of 
> the the iconv_t and use that to do the lookahead.

No, you cannot copy an iconv_t. When you tie an iconv_t to a stream, the
iconv_t can only go forward and never go backwards or restart at an earlier
position (at least for stateful encodings).

> The problem with the legacy input API w.r.t stateful encodings is the
> 'unread-char' and 'unread-string' operations.  Unreading stateful encodings
> is difficult. (It could be done in our legacy ports by always keeping
> a dynamically allocated pushback buffer encoded in UTF-32 or UTF-8

Yes, this is a possible technique. However, in some cases (e.g. parsing of HTTP
requests) people want to switch from one input encoding to another. If
you have already converted the input to Unicode and put something into the
pushback buffer and _then_ try to switch to another encoding, it gets ugly.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]