File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ size_t strcplen(const char* buf, bool utf8);
1515const char * getCodePointFromUTF8Sequence (const char * buf , uint32_t * out );
1616char * getUTF8String (const char * input );
1717char * getCP1252String (const char * input );
18+ char toupperCP1252 (char c );
1819
1920uint32_t getUnicodeFromCP1252 (char input ) {
2021 switch ((unsigned char )input ) {
@@ -144,7 +145,7 @@ char getCP1252FromUnicode(uint32_t input) {
144145 return (char )input ;
145146 }
146147 else {
147- return '\x20 ' ; // SPACE
148+ return '\x3F ' ; // QUESTION MARK
148149 }
149150 }
150151}
@@ -274,4 +275,20 @@ char* getCP1252String(const char* input) {
274275 return ret ;
275276}
276277
278+ char toupperCP1252 (char c ) {
279+ if (c >= 'a' && c <= 'z' ) {
280+ c -= 32 ;
281+ }
282+ else if (c == '\x9A' || c == '\x9C' || c == '\x9E' ) {
283+ c -= 16 ;
284+ }
285+ else if ((c >= '\xE0' && c <= '\xF6' ) || (c >= '\xF8' && c <= '\xFE' )) {
286+ c -= 32 ;
287+ }
288+ else if (c == '\xFF' ) {
289+ c = '\x9F' ;
290+ }
291+ return c ;
292+ }
293+
277294#endif //CP1252_INCLUDED
Original file line number Diff line number Diff line change @@ -1568,11 +1568,8 @@ int avl_compare_key( const char *in_lhs, const char *in_rhs ) {
15681568 unsigned char a , b ;
15691569
15701570 for ( ;; ) {
1571- a = (unsigned char )* in_lhs ++ ;
1572- b = (unsigned char )* in_rhs ++ ;
1573-
1574- if ( a >= 'a' && a <= 'z' ) a -= 32 ; // uppercase(a);
1575- if ( b >= 'a' && b <= 'z' ) b -= 32 ; // uppercase(b);
1571+ a = (unsigned char )toupperCP1252 (* in_lhs ++ );
1572+ b = (unsigned char )toupperCP1252 (* in_rhs ++ );
15761573
15771574 if ( a ) {
15781575 if ( b ) {
You can’t perform that action at this time.
0 commit comments