Re: display undeclared iso-charset in UTF environment
Christian Ebert <[email protected]>
| Newsgroups | gmane.network.slrn.user |
|---|---|
| Organization | Black Trash Productions <http://www.blacktrash.org/> |
| Message-ID | <[email protected]> |
* Alain Bench on Saturday, September 09, 2006 at 20:22:30 +0200: > On Friday, September 8, 2006 at 15:46:58 +0200, Christian Ebert wrote: >> But I want to see Euros, loads of 'em! > > Quick and easy: Just send 5€ to each one on the list, subscribe > yourself on top, and wait some days for loads of return. ;-) But I'm already waiting for quite a long time now ... > It's a false friend: Assuming unlabelled means Latin-9 would, in > most cases, wrongly show €uros where there are not intended, and show > question marks where €uros really are. Of course if an article happens > to be L9, then you get rich. But it's a minority case. The balance is > completely for 1252. Understood by now. >> * Alain Bench on Friday, September 08, 2006 at 02:55:28 +0200: >>> some auto-sensing between UTF-8 and CP-1252 > > Pseudo code: Incorporated in a layman's way in attached version. The calls to iconv are a bit expensive and noisy, but of course this is much more flexible. >>> grep for any char above 0x80? >> how do I do that in s-lang? > > string_match (rawart, "[\x80-\xFF]", 1) ahem, yes, ahem, it just shows sometimes that I adhere to the why-simple-when-you-can-do-it-longwinded philosophy ... But, just to be sure, is the above range the same as in decimal "[\d128-\d255]" ? Is there any advantage of hex over decimal? -- All the hex, octal stuff completely escapes me. >>> better way to get current CODESET >> I don't know it. > > Me neither. Hum... in the absence of "nl_langinfo(CODESET)" and > "locale charmap", I would probably call locale_charset.c, attached. It > has the advantage to always give a canonicalized charset name, while > nl_langinfo on some platforms may give st*pid names. Like HP-UX giving > "utf8", and by default refusing the standard "utf-8" with dash. Thanks a lot, Alain. It's fun learning from your input (even though I /should/ be doing supposedly more important stuff). c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.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
guess-charset.sl.gz
(application/x-gunzip, 3.1 KB) - not displayed