All pastes #291133 Raw Edit

zamaliphe

public c v1 · immutable
#291133 ·published 2006-12-24 20:08 UTC
rendered paste body
#include <string.h>#include <unistd.h>#include "malloc.h"#include "stdlib.h"#include "stdio.h"#include <wchar.h>#include <errno.h>#include <langinfo.h>#include "minibidi.c"#include <locale.h>int main(int argc, char *argv[],char *envp[]){		//setlocale(LC_ALL, "");			if (setlocale (LC_ALL, "") == NULL)		perror ("Cannot set LC_ALL to default locale");			char * lang_encoding = nl_langinfo(CODESET);	int i = strlen(lang_encoding);	++i;	wchar_t *line;		line =(wchar_t *) malloc (i);		if (setlocale (LC_ALL, "") == NULL)		perror ("&#1593;&#1585;&#1576;&#1609;");	if ((size_t) -1 == mbstowcs(line, lang_encoding, (size_t) i)) { perror("mbstowcs\n");  exit(3);}		wchar_t ccc = {0x330, 0x250, 0x330, 0x263, 0x331, 0x205,'  ' 			, 0x330, 0x247, 0x331, 0x204, 0x331, 0x204, 0x331, 0x207};	wchar_t cc2[] = {0x0630,0x0670,0x0671,0x0672};	wchar_t cca[] = {0x330,0x0330,0x331,0x332};		if (-1 == wprintf(line)) { perror("wprintf(line)\n");  exit(3);}	if (-1 == wprintf(L"\n")) { perror("wprintf\n"); exit(3); }	if (-1 == wprintf(ccc)) { perror("wprintf(ccc)\n");exit(3);  }	if (-1 == wprintf(L"\n")) { perror("wprintf\n"); exit(3); }		if (-1 == wprintf(cc2)) { perror("wprintf(cc2)\n");  exit(3);}		if (-1 == wprintf(cca)) { perror("wprintf(cca)\n"); exit(3);}	if (-1 == wprintf(L"\n")) { perror("wprintf\n"); exit(3); }		free(line);		return 0;}