/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that converts the multibyte character in s
into its equivalent wide character and puts the result in the 
array  pointed to by pwcs. */
#include <wchar.h>
#include <stdlib.h>

int main() {
    char s[] = "This is a test";
    wchar_t pwcs[8];
    size_t n;
  
    n = 1; 
    if(mbtowc(pwcs,s,n) == -1) {
      printf("error convert\n");   
      exit(1);
    }
    printf("The original string is: %s\n", s);
    printf("The converted characters are: ");
    fputws(pwcs, stdout);
    fputs("\n", stdout);
}
