toddy15 / isoquery Goto Github PK
View Code? Open in Web Editor NEWSearch and display various ISO codes (country, language, currency, ...)
License: GNU General Public License v3.0
Search and display various ISO codes (country, language, currency, ...)
License: GNU General Public License v3.0
configure.ac:49:if test x"$RST2MAN" == x"no" ; then
configure.ac:53:if test x"$PO4A_TRANSLATE" == x"no" ; then
configure.ac:57:if test x"$PO4A_GETTEXTIZE" == x"no" ; then
Hello,
On a system running Arch Linux, make check
fails (with isoquery 3.2.3):
PASS: options 1 /options/standard_default
PASS: options 2 /options/standard_provided
PASS: options 3 /options/standard_deprecated_639
PASS: options 4 /options/standard_deprecated_3166
PASS: options 5 /options/standard_invalid
PASS: options 6 /options/pathname_default
PASS: options 7 /options/pathname_provided
PASS: options 8 /options/pathname_provided_with_dir_separator
PASS: options 9 /options/pathname_from_standard
PASS: options 10 /options/name_default
PASS: options 11 /options/name_name
PASS: options 12 /options/name_official_name
PASS: options 13 /options/name_common_name
PASS: options 14 /options/null_separator
PASS: options 15 /options/invalid_option
ERROR: integration - Bail out! ERROR:integration.c:88:test_integration_add_test_from_files: stdout of child process (/integration/iso_639-2/all_localized [21291]) failed to match: aar aa afar
In directory tests
, I get:
$ ./integration
/integration/iso_639-2/all_localized: **
ERROR:integration.c:88:test_integration_add_test_from_files: stdout of child process (/integration/iso_639-2/all_localized [23201]) failed to match: aar aa afar
alg algonquines, langues
bod tib bo tib?tain
heb he h?breu
Aborted (core dumped)
$ env -i LC_ALL=en_US.UTF-8 ../src/isoquery -p data -i 639-2 -l fr
aar aa afar
alg algonquines, langues
bod tib bo tibétain
heb he hébreu
$ env -i LC_ALL=C.UTF-8 ../src/isoquery -p data -i 639-2 -l fr
aar aa Afar
alg Algonquian languages
bod tib bo Tibetan
heb he Hebrew
It looks strange that $LC_ALL
(or $LANG
) matters when using option -l
. As expected/iso_639-2/all_localized_test_stdout.txt
matches the first output but not the one with LANG=C.UTF-8
, this seems to be a bug in the way C.UTF-8
is handled.
On this system, there is:
Cygwin make check
build fails with undefined references (see bottom) as object file path names OBJ.o
follow required library options -l
LIB, rather than the required library options appearing at the end of gcc
command lines.
Note:
pkg-config --cflags <LIB>
should precede program build options and files andpkg-config --libs <LIB>
should follow all other options, to build on non-Linux systems that do not support dynamic library runtime loader reference fixups.
This definition appears to be the cause:
tests/Makefile.am:22:LDADD = $(GLIB_LIBS) $(JSON_LIBS) $(top_builddir)/src/options.o
Applied the attached patch: isoquery-3.2.7-tests-Makefile-am-LDADD-order.patch.txt
make options.exe integration.exe \
make[3]: Entering directory '/mnt/c/Users/bwi/src/cygwin/isoquery/isoquery-3.2.7-1.x86_64/build/tests'
gcc -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 ... -o options.exe options.o -lglib-2.0 -lintl -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl ../src/options.o
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: ../src/options.o: in function `options_validate':
/usr/src/debug/isoquery-3.2.7-1/src/options.c:122: undefined reference to `g_printerr'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:127: undefined reference to `g_printerr'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:142: undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:142: undefined reference to `g_set_error'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: ../src/options.o: in function `options_parse_command_line':
/usr/src/debug/isoquery-3.2.7-1/src/options.c:82: undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:82: undefined reference to `g_option_context_new'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:83: undefined reference to `g_option_context_add_main_entries'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:90: undefined reference to `g_option_context_parse'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: ../src/options.o: in function `options_get_filename':
/usr/src/debug/isoquery-3.2.7-1/src/options.c:164: undefined reference to `g_strdup_printf'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:165: undefined reference to `g_build_filename'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:166: undefined reference to `g_free'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: ../src/options.o: in function `options_show_version':
/usr/src/debug/isoquery-3.2.7-1/src/options.c:176: undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:176: undefined reference to `g_printf'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:177: undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:177: undefined reference to `g_printf'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:180: undefined reference to `libintl_gettext'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:181: undefined reference to `g_strrstr'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:184: undefined reference to `g_print'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:185: undefined reference to `g_print'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:186: undefined reference to `g_print'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:187: undefined reference to `g_print'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:188: undefined reference to `g_print'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: ../src/options.o:/usr/src/debug/isoquery-3.2.7-1/src/options.c:189: more undefined references to `g_print' follow
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: ../src/options.o: in function `options_show_version':
/usr/src/debug/isoquery-3.2.7-1/src/options.c:182: undefined reference to `g_printf'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /usr/src/debug/isoquery-3.2.7-1/src/options.c:196: undefined reference to `g_print'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:787: options.exe] Error 1
Hi,
it would be cool if isoquery would—maybe optionally—also output the two-letter code of ISO3166-1 in Unicode "REGIONAL INDICATOR SYMBOL LETTERs", e.g. "REGIONAL INDICATOR SYMBOL LETTER D" and "REGIONAL INDICATOR SYMBOL LETTER E" for 🇩🇪 or "REGIONAL INDICATOR SYMBOL LETTER C" and "REGIONAL INDICATOR SYMBOL LETTER H" for 🇨🇭.
As a proof of concept (no proper parameter handling, just supporting ISO 3166-1, only works with UTF-8, etc.) I made a small perl wrapper around isoquery
which I call isoflags
:
#!/usr/bin/perl
use strict;
use warnings;
use 5.014; # for non-destructive substitution (s///r)
use open IN => ":encoding(UTF-8)";
binmode STDOUT, ":utf8";
# map "A" to "Z" to "REGIONAL INDICATOR SYMBOL LETTER A" to "REGIONAL
# INDICATOR SYMBOL LETTER Z"
my %fc = map { $_ => chr(ord($_)-65+0x1f1e6) } ( 'A' .. 'Z' );
foreach my $iso (`isoquery @ARGV`) {
my $cc = substr($iso, 0, 2);
print cc2fl($cc).' '.$iso;
}
sub cc2fl {
$_[0] =~ s/./$fc{$&}/gr;
}
Some example output using options and parameters (which are all just passed through to isoquery
):
~ → bin/isoflag.pl --locale=de ax at dk tf bl by za tr sx ru ps pf
🇦🇽 AX ALA 248 Åland-Inseln
🇦🇹 AT AUT 040 Österreich
🇩🇰 DK DNK 208 Dänemark
🇹🇫 TF ATF 260 Französische Süd- und Antarktisgebiete
🇧🇱 BL BLM 652 Saint-Barthélemy
🇧🇾 BY BLR 112 Weißrussland
🇿🇦 ZA ZAF 710 Südafrika
🇹🇷 TR TUR 792 Türkei
🇸🇽 SX SXM 534 Saint-Martin (Niederländischer Teil)
🇷🇺 RU RUS 643 Russische Föderation
🇵🇸 PS PSE 275 Palästina, Staat
🇵🇫 PF PYF 258 Französisch-Polynesien
(Examples have been choosen by country names which have umlauts in German and which either appear near the beginning or near the end of the output. Order as I noticed them.)
And once again with proper identiation, but non-working flags (Github Markdown rendering issue—or maybe feature, I don't know):
~ → bin/isoflag.pl --locale=de ax at dk tf bl by za tr sx ru ps pf
🇦🇽 AX ALA 248 Åland-Inseln
🇦🇹 AT AUT 040 Österreich
🇩🇰 DK DNK 208 Dänemark
🇹🇫 TF ATF 260 Französische Süd- und Antarktisgebiete
🇧🇱 BL BLM 652 Saint-Barthélemy
🇧🇾 BY BLR 112 Weißrussland
🇿🇦 ZA ZAF 710 Südafrika
🇹🇷 TR TUR 792 Türkei
🇸🇽 SX SXM 534 Saint-Martin (Niederländischer Teil)
🇷🇺 RU RUS 643 Russische Föderation
🇵🇸 PS PSE 275 Palästina, Staat
🇵🇫 PF PYF 258 Französisch-Polynesien
Maybe isoquery
could add support to output these flags on its own. That'd be cool. 😎
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.