guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SRFI-14 and locale settings


From: Kevin Ryde
Subject: Re: SRFI-14 and locale settings
Date: Thu, 14 Sep 2006 10:07:56 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

address@hidden (Ludovic Courtès) writes:
>
> An example to illustrate what
> I was trying to say: Both French and Castellano can be written using
> Latin-1; however, letter `ñ' (`n' with tilde) is not a French letter
> (thus, `isalpha ()' would return false with a Latin-1 `fr_FR' locale)

In glibc fr_FR and es_ES have the same isalpha for all chars 0 to 255,
it appears to be a property of the charset, not the language or
location.




#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>

int fr[256];
int es[256];

int
main (void)
{
  int i;

  if (setlocale (LC_ALL, "fr_FR") == NULL)
    abort();
  printf ("%d\n", isalpha (0xEA));
  for (i = 0; i < 256; i++)
    fr[i] = isalpha (i);

  if (setlocale (LC_ALL, "es_ES") == NULL)
    abort();
  printf ("%d\n", isalpha (0xEA));
  for (i = 0; i < 256; i++)
    es[i] = isalpha (i);

  for (i = 0; i < 256; i++)
    if (fr[i] != es[i])
      printf ("%d\n", i);

  return 0;
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]