Skip to content

Instantly share code, notes, and snippets.

@chryss
Created August 5, 2010 22:54
Show Gist options
  • Save chryss/510544 to your computer and use it in GitHub Desktop.
Save chryss/510544 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
#include <locale.h>
int main (void) {
struct lconv locale_structure;
struct lconv *locale_ptr = &locale_structure;
char *a = "ä";
char *b = "b";
char *c = "c";
setlocale(LC_ALL, "de_DE.UTF-8");
locale_ptr=localeconv();
printf("Currency symbol: %s\n", locale_ptr->currency_symbol);
printf("%s\n", a);
printf("%d\n", strcoll(a, b));
printf("%d\n", strcoll(b, c));
}
@chryss
Copy link
Author

chryss commented Aug 5, 2010

Output on Ubuntu 10.4, gcc 4.4.3:
Currency symbol: €
ä
-1
-1

Output on OS X 10.6.4, gcc 4.2.1:
Currency symbol: Eu
ä
130
-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment