E
eli m
Hi guys, I have a program where it gets input and assigns it to a string. How do I make the input get converted into lowercase? Thanks in advance!
eli said:Hi guys, I have a program where it gets input and assigns it to a
string. How do I make the input get converted into lowercase? Thanks
in advance!
tolower doesn't assume ASCII.
James said:But it does assume single byte encodings, no UTF-8. (And of
course, it also supposes that tolower has a reasonable
definition. It won't work with German, for example, where the
lower case of "SS" may be either "ss" or "ß", depending on
context, or in some conventions of French, where the lower case
of "E" may be "é", "è", "ê", "ë" or "e", depending on context.
The idea of converting a string to lower case with a linguistic
context is non-trivial, and may not even be possible.)
More to the point, of course, there are a couple of very subtle
issues when using std::transform and tolower. You can't simply
pass the tolower from <ctype.h> to std::transform, at least if
you're iterating over char, because the tolower in <ctype.h>
results in undefined behavior when called with a char. And once
you include <locale>, you get all sorts of issues regarding
ambiguity. (And of course, you don't always know whether
<locale> has been included or not.)
[..]
The upshot was I got interested in what was the glyph for the lower case ß.
So your answer is "There is none!"". So now I know. I think.
Victor Bazarov said:[..]
The upshot was I got interested in what was the glyph for the lower case
ß.
So your answer is "There is none!"". So now I know. I think.
Uh... The "ß" *is* the lower case. The *upper*case is SS.
Victor Bazarov said:[..]
The upshot was I got interested in what was the glyph for the lower case
ß.
So your answer is "There is none!"". So now I know. I think.
Uh... The "ß" *is* the lower case. The *upper*case is SS.
Oops. Thanks, Victor.
It just *looks* so upper case. The first time I saw it I thought it was a
Greek upper case beta.
We Americans are quite insular. But you probably already knew that.
Victor Bazarov said:Uh... The "ß" *is* the lower case. The *upper*case is SS.[..]
The upshot was I got interested in what was the glyph for the lower case ß.
So your answer is "There is none!"". So now I know. I think.
osmium said:Victor Bazarov said:[..]
The upshot was I got interested in what was the glyph for the lower case
ß.
So your answer is "There is none!"". So now I know. I think.
Uh... The "ß" *is* the lower case. The *upper*case is SS.
Oops. Thanks, Victor.
It just *looks* so upper case. The first time I saw it I thought it was a
Greek upper case beta.
We Americans are quite insular. But you probably already knew that.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.