This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Character set of a locale
- From: ludo at gnu dot org (Ludovic CourtÃs)
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-help at sourceware dot org
- Date: Thu, 10 Sep 2015 17:56:09 +0200
- Subject: Re: Character set of a locale
- Authentication-results: sourceware.org; auth=none
- References: <55F01A7F dot 9070208 at redhat dot com>
Florian Weimer <fweimer@redhat.com> skribis:
> Is there a way to print the character set of the current locale using a
> command line tool? âlocaleâ does not print this information, unfortunately.
Probably not as convenient as youâd like:
--8<---------------cut here---------------start------------->8---
$ guile -c '(use-modules (ice-9 i18n)) \
(display (locale-encoding (make-locale LC_ALL "fr_FR.utf8")))'
UTF-8
--8<---------------cut here---------------end--------------->8---
It uses ânewlocaleâ and ânl_langinfo_lâ.
Ludoâ.