~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/ctype.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
  This files implements routines which parse XML based
23
23
  character set and collation description files.
24
 
  
 
24
 
25
25
  Unicode collations are encoded according to
26
 
  
 
26
 
27
27
    Unicode Technical Standard #35
28
28
    Locale Data Markup Language (LDML)
29
29
    http://www.unicode.org/reports/tr35/
30
 
  
 
30
 
31
31
  and converted into ICU string according to
32
 
  
 
32
 
33
33
    Collation Customization
34
34
    http://oss.software.ibm.com/icu/userguide/Collate_Customization.html
35
 
  
 
35
 
36
36
*/
37
37
 
38
38
struct my_cs_file_section_st
96
96
  Detect whether a character set is ASCII compatible.
97
97
 
98
98
  Returns true for:
99
 
  
 
99
 
100
100
  - all 8bit character sets whose Unicode mapping of 0x7B is '{'
101
101
    (ignores swe7 which maps 0x7B to "LATIN LETTER A WITH DIAERESIS")
102
 
  
 
102
 
103
103
  - all multi-byte character sets having mbminlen == 1
104
104
    (ignores ucs2 whose mbminlen is 2)
105
 
  
 
105
 
106
106
  TODO:
107
 
  
 
107
 
108
108
  When merging to 5.2, this function should be changed
109
 
  to check a new flag MY_CS_NONASCII, 
110
 
  
 
109
  to check a new flag MY_CS_NONASCII,
 
110
 
111
111
     return (cs->flag & MY_CS_NONASCII) ? 0 : 1;
112
 
  
 
112
 
113
113
  This flag was previously added into 5.2 under terms
114
114
  of WL#3759 "Optimize identifier conversion in client-server protocol"
115
115
  especially to mark character sets not compatible with ASCII.
116
 
  
 
116
 
117
117
  We won't backport this flag to 5.0 or 5.1.
118
118
  This function is Ok for 5.0 and 5.1, because we're not going
119
119
  to introduce new tricky character sets between 5.0 and 5.2.
121
121
bool
122
122
my_charset_is_ascii_based(const CHARSET_INFO * const cs)
123
123
{
124
 
  return 
 
124
  return
125
125
    (cs->mbmaxlen == 1 && cs->tab_to_uni && cs->tab_to_uni['{'] == '{') ||
126
126
    (cs->mbminlen == 1 && cs->mbmaxlen > 1);
127
127
}