* libc/locale/nl_langinfo.c (nl_langinfo): On Cygwin, translate
often-used charsets into Linux compatible codesets.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2010-01-20  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
|  | 	* libc/locale/nl_langinfo.c (nl_langinfo): On Cygwin, translate | ||||||
|  | 	often-used charsets into Linux compatible codesets. | ||||||
|  |  | ||||||
| 2010-01-19  Andy Koppe  <andy.koppe@gmail.com> | 2010-01-19  Andy Koppe  <andy.koppe@gmail.com> | ||||||
|  |  | ||||||
| 	* libc/stdio/vfscanf.c (__SVFSCANF_R): Fix handling of non-ASCII | 	* libc/stdio/vfscanf.c (__SVFSCANF_R): Fix handling of non-ASCII | ||||||
|   | |||||||
| @@ -60,12 +60,25 @@ _DEFUN(nl_langinfo, (item), | |||||||
| 	case CODESET: | 	case CODESET: | ||||||
| #ifdef __CYGWIN__ | #ifdef __CYGWIN__ | ||||||
| 		ret = __locale_charset (); | 		ret = __locale_charset (); | ||||||
| 		/* Temporary exception for KOI8 charsets which are | 		/* Convert charset to Linux compatible codeset string. */ | ||||||
| 		   incorrectly treated by calling applications otherwise. */ | 		if (ret[0] == 'A'/*SCII*/) | ||||||
| 		if (strcmp (ret, "CP20866") == 0) | 		  ret = "ANSI_X3.4-1968"; | ||||||
| 		  ret = "KOI8-R"; | 		else if (ret[0] == 'E') | ||||||
| 		else if (strcmp (ret, "CP21866") == 0) | 		  { | ||||||
| 		  ret = "KOI8-U"; | 		    if (strcmp (ret, "EUCJP") == 0) | ||||||
|  | 		      ret = "EUC-JP"; | ||||||
|  | 		    else if (strcmp (ret, "EUCKR") == 0) | ||||||
|  | 		      ret = "EUC-KR"; | ||||||
|  | 		  } | ||||||
|  | 		else if (ret[0] == 'C'/*Pxxxx*/) | ||||||
|  | 		  { | ||||||
|  | 		    if (strcmp (ret + 2, "874") == 0) | ||||||
|  | 		      ret = "TIS-620"; | ||||||
|  | 		    else if (strcmp (ret + 2, "20866") == 0) | ||||||
|  | 		      ret = "KOI8-R"; | ||||||
|  | 		    else if (strcmp (ret + 2, "21866") == 0) | ||||||
|  | 		      ret = "KOI8-U"; | ||||||
|  | 		  } | ||||||
| #else | #else | ||||||
| 		ret = ""; | 		ret = ""; | ||||||
| 		if ((s = setlocale(LC_CTYPE, NULL)) != NULL) { | 		if ((s = setlocale(LC_CTYPE, NULL)) != NULL) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user