Ticket #388: get_locale.sh
File get_locale.sh, 411 bytes (added by slyfox, 16 years ago) |
---|
Line | |
---|---|
1 | #!/bin/sh |
2 | |
3 | tmp_name=`mktemp "/tmp/locale_test_XXXXXXXXXXXXXXXX"` |
4 | tmp_c_file=$tmp_name.c |
5 | tmp_bin_file=$tmp_name.elf |
6 | |
7 | cat > "$tmp_c_file" << EOF |
8 | #include <stdio.h> |
9 | #include <locale.h> |
10 | #include <langinfo.h> |
11 | |
12 | int main() |
13 | { |
14 | setlocale (LC_ALL, ""); |
15 | printf ("CODESET: '%s'\n", nl_langinfo (CODESET)); |
16 | return 0; |
17 | } |
18 | EOF |
19 | |
20 | gcc $tmp_c_file -o $tmp_bin_file |
21 | $tmp_bin_file |
22 | rm -f $tmp_c_file $tmp_bin_file $tmp_name |