Re: display undeclared iso-charset in UTF environment
Alain Bench <[email protected]>
| Newsgroups | gmane.network.slrn.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Christian,
On Wednesday, September 13, 2006 at 14:21:51 +0200, Christian Ebert wrote:
> * Alain Bench on Tuesday, September 12, 2006 at 15:49:07 +0200:
>> loop all but last candidates, and if all fail convert -f last
>> (implicitly -t locale) and display. Economy: 1 iconv call.
> done
I don't exec but just read, so I maybe missed something, but it
doesn't seem to work? The guessing loop still checks the whole charset
list, including the last one.
The economy plan needs the loop shorter by 1 lap, needs to set a
flag on success (just before the loop break), and to set guess=last
after a skipped or unsucessfull loop. An example might be clearer: In
"utf-8,cp1252" list, loop thru... utf-8 only. If the article converts
properly to Unicode, guess=utf-8. Otherwise guess=cp1252 (without
checking it first).
An UTF-8 article will trigger 2 iconvs:
-1) -s -f utf-8 -t ucs-4 validity check SUCCESS
-2) -c -f utf-8 replace_article()
...and a CP-1252 article will trigger 2 iconvs (instead of 3):
-1) -s -f utf-8 -t ucs-4 validity check FAILURE
-2) -c -f cp1252 replace_article()
Bye! Alain.
--
How to Report Bugs Effectively
<URL:http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642