mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* configure.in, win32/Makefile.sub (MISSING): added langinfo on mingw
and mswin. * encoding.c (rb_locale_charmap): use environments on mingw and mswin. * missing/langinfo.c (nl_langinfo_codeset): MS-Windows Japanese environment uses Windows-31J derived from Shift_JIS, not EUC-JP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									9e99ce3831
								
							
						
					
					
						commit
						ece0628ebe
					
				
					 5 changed files with 20 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -36,7 +36,6 @@
 | 
			
		|||
#include <string.h>
 | 
			
		||||
#if defined _WIN32 || defined __CYGWIN__
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
int snprintf(char *, size_t, const char *, ...);
 | 
			
		||||
#if defined _WIN32
 | 
			
		||||
#define strncasecmp strnicmp
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -49,6 +48,12 @@ int snprintf(char *, size_t, const char *, ...);
 | 
			
		|||
				  * C/POSIX locale. Could as well one day
 | 
			
		||||
				  * become "UTF-8". */
 | 
			
		||||
 | 
			
		||||
#if defined _WIN32 || defined __CYGWIN__
 | 
			
		||||
#define JA_CODESET "Windows-31J"
 | 
			
		||||
#else
 | 
			
		||||
#define JA_CODESET "EUC-JP"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define digit(x) ((x) >= '0' && (x) <= '9')
 | 
			
		||||
#define strstart(s, n) (strncasecmp(s, n, strlen(n)) == 0)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -94,7 +99,7 @@ nl_langinfo_codeset(void)
 | 
			
		|||
    if (strstart(l, "zh_TW")) return "Big5";
 | 
			
		||||
    if (strstart(l, "zh_HK")) return "Big5HKSCS";   /* no MIME charset */
 | 
			
		||||
    if (strstart(l, "zh")) return "GB2312";
 | 
			
		||||
    if (strstart(l, "ja")) return "EUC-JP";
 | 
			
		||||
    if (strstart(l, "ja")) return JA_CODESET;
 | 
			
		||||
    if (strstart(l, "ko")) return "EUC-KR";
 | 
			
		||||
    if (strstart(l, "ru")) return "KOI8-R";
 | 
			
		||||
    if (strstart(l, "uk")) return "KOI8-U";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue