jed-users mailing list

[2008 Date Index] [2008 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: iconv module documentation or examples?


Dino spake unto us the following wisdom:
> > Just curious: how could I find out the (iconv-compatible) name of the
> > current locale's encoding in a S-Lang script?
> 
> Well, this is why I didn't implement exactly the same interface of the
> standard 'iconv' program :-) I don't know how to get the iconv-compatible
> name of the character set used by current locale (not in SLang, niether in
> C), but if somebody finds a way to do this, it should be easy to update the
> script.

I'm not sure if this is what you want, but ...

#include <langinfo.h>

char *nl_langinfo(nl_item item);

If you pass CODESET as the argument to this function, it should give
you back the character encoding used by the active locale.  This
function will give you most of the information you would retrieve with
the locale(1) query commands.

Ethan

-- 
The laws that forbid the carrying of arms are laws [that have no remedy
for evils].  They disarm only those who are neither inclined nor
determined to commit crimes.
		-- Cesare Beccaria, "On Crimes and Punishments", 1764

Attachment: signature.asc
Description: Digital signature


[2008 date index] [2008 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]