Created
August 5, 2010 22:54
-
-
Save chryss/510544 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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