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?


Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
> What's with LC_ALL and LC_CTYPE?

By this, I assume that you mean that the function should be changed to
something like:

   define get_encoding ()
   {
      if (_slang_utf8_ok) return "UTF-8";

      foreach (["LC_ALL", "LC_CTYPE", "LANG"])
	{
	   variable env = ();
	   variable lang = getenv (env);
	   if (lang == NULL)
	     continue;

	   variable fields = strchop (lang, '.', 0);
	   if (length (fields) >= 2)
	     return strchop (fields[1], '@', 0)[0];
	}
      return NULL;
   }

Thanks,
--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


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