/[projects]/smsdaemon/Util.cpp
ViewVC logotype

Diff of /smsdaemon/Util.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 107 by torben, Thu Jun 19 14:47:52 2008 UTC revision 108 by torben, Fri Jul 4 07:58:26 2008 UTC
# Line 105  namespace Util Line 105  namespace Util
105                  return retval;                  return retval;
106          }          }
107    
108            char my_toupper(char ch)
109            {
110                    if (ch == 'æ')
111                            return 'Æ';
112                    if (ch == 'ø')
113                            return 'Ø';
114                    if (ch == 'å')
115                            return 'Å';
116    
117                    return ::toupper(ch);
118            }
119    
120            char my_tolower(char ch)
121            {
122                    if (ch == 'Æ')
123                            return 'æ';
124                    if (ch == 'Ø')
125                            return 'ø';
126                    if (ch == 'Å')
127                            return 'å';
128    
129                    return ::tolower(ch);
130            }
131      string str_toupper(string str)      string str_toupper(string str)
132          {          {
133                  for (unsigned i=0; i<str.length(); ++i)                  for (unsigned i=0; i<str.length(); ++i)
134                  {                  {
135                          str.replace(i, 1 ,1, ::toupper(str.at(i)));                          str.replace(i, 1 ,1, my_toupper(str.at(i)));
136                  }                  }
137                  return str;                  return str;
138          }          }
# Line 119  namespace Util Line 141  namespace Util
141          {          {
142                  for (unsigned i=0; i<str.length(); ++i)                  for (unsigned i=0; i<str.length(); ++i)
143                  {                  {
144                          str.replace(i, 1 ,1, ::tolower(str.at(i)));                          str.replace(i, 1 ,1, my_tolower(str.at(i)));
145                  }                  }
146                  return str;                  return str;
147          }          }

Legend:
Removed from v.107  
changed lines
  Added in v.108

  ViewVC Help
Powered by ViewVC 1.1.20