#include  <stdio.h>
#include  <string.h>
#include  <locale.h>
#include  <stdlib.h>
 
extern int  errno;

/*
 * The following example uses the wcscoll subroutine to compare
 * two wide character strings based on their collation weights.
 */
int main(int argc, char **argv) {
    wchar_t  *pwcs1, *pwcs2;
    size_t   n;
 
    setlocale(LC_ALL,  "");
    
    /* set it to zero for checking errors on wcscoll */
    errno  =  0;
    /*
     * Let pwcs1 and pwcs2 be two wide character strings to
     * compare.
     */
    n = wcscoll(pwcs1, pwcs2);
    /*
     * If errno is set then it indicates some
     * collation error.
     */
    if(errno  !=  0) {
        /* error has occurred... handle error... */
    }
    
    return (0);
}