comparison dwcompat.c @ 1640:b8604e5fc85e

Removed now unneeded locale conversion on Windows since everything is UTF-8.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 02 Apr 2012 19:25:09 +0000
parents f8d1da63fb77
children b217cf9161c7
comparison
equal deleted inserted replaced
1639:5c8a5c894ab0 1640:b8604e5fc85e
720 return 1; 720 return 1;
721 } 721 }
722 } 722 }
723 return 1; 723 return 1;
724 } 724 }
725
726 #ifdef __WIN32__
727 #define LOCALE_CHARACTERS 62
728 static char locale_table[LOCALE_CHARACTERS * 2] = {
729 0xc0, 0xb7, 0xc1, 0xb5, 0xc2, 0xb6, 0xc3, 0xc7, 0xc4, 0x8e, 0xc5, 0x8f,
730 0xc6, 0x92, 0xc7, 0x80, 0xc8, 0xd4, 0xc9, 0x90, 0xcb, 0xd3, 0xcc, 0xde,
731 0xcd, 0xd6, 0xce, 0xd7, 0xcf, 0xd8, 0xd0, 0xd1, 0xd1, 0xa5, 0xd2, 0xe3,
732 0xd3, 0xe0, 0xd4, 0xe2, 0xd5, 0xe5, 0xd6, 0x99, 0xd8, 0x9d, 0xd9, 0xeb,
733 0xda, 0xe9, 0xdb, 0xea, 0xdc, 0x9a, 0xde, 0xed, 0xde, 0xe8, 0xdf, 0xe1,
734 0xe0, 0x85, 0xe1, 0xa0, 0xe2, 0x83, 0xe3, 0xc6, 0xe4, 0x84, 0xe5, 0x86,
735 0xe6, 0x91, 0xe7, 0x87, 0xe8, 0x8a, 0xe9, 0x82, 0xea, 0x88, 0xeb, 0x89,
736 0xec, 0x8d, 0xed, 0xa1, 0xee, 0x8c, 0xef, 0x8b, 0xf0, 0xd0, 0xf1, 0xa4,
737 0xf2, 0x95, 0xf3, 0xa3, 0xf4, 0x93, 0xf5, 0xe4, 0xf6, 0x94, 0xf7, 0xf6,
738 0xf8, 0x9b, 0xf9, 0x97, 0xfa, 0xa3, 0xfb, 0x96, 0xfc, 0x81, 0xfd, 0xec,
739 0xfe, 0xe7, 0xff, 0x9e
740
741 };
742
743 char locale_convert(int codepage, char c)
744 {
745 int z;
746
747 for(z=0;z<LOCALE_CHARACTERS;z++)
748 {
749 if(locale_table[(z*2)+1] == c)
750 return locale_table[z*2];
751 }
752 return c;
753 }
754 #endif
755 725
756 /* Initialize the locale engine 726 /* Initialize the locale engine
757 * Returns: TRUE on success, FALSE on failure. 727 * Returns: TRUE on success, FALSE on failure.
758 */ 728 */
759 int API locale_init(char *filename, int my_locale) 729 int API locale_init(char *filename, int my_locale)
819 x++; 789 x++;
820 z++; 790 z++;
821 } 791 }
822 else 792 else
823 { 793 {
824 #ifdef __WIN32__
825 locale_text[current][x] = locale_convert(1252, text[z]);
826 #else
827 locale_text[current][x] = text[z]; 794 locale_text[current][x] = text[z];
828 #endif
829 x++; 795 x++;
830 } 796 }
831 } 797 }
832 } 798 }
833 current++; 799 current++;