
Sebastian Redl wrote:
Gennaro Prota wrote:
What I was hinting at is that not all languages have "uppercase" and/or "lowercase". And in those that have there's no guarantee of one-to-one mapping, so that to_lower or to_upper aren't in general invertible functions, or even left-invertible functions.
Or even possible functions: to_upper applied to the single German character ß ("sharp s") should yield "SS" ("SZ" a few decades ago) - an impossibility for the current interface.
Right! All the more reason to go for the functional non-mutating approach. In many (most?) cases, you'll end up with a new transformed string. In-situ conversions/transformations seem to be less common in reality, especially when dealing with different encodings and different string types. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net