How to conversion from upper case string to lower case in MFC.
-
Hi.. Use _tcsicmp
Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju
why bothering cast back to TCHAR*, uppercase, then cast back to CString, when the CString class already provides a method to do it ? moreover, _tcsicmp() doesn't perform a "toUpper" or a "toLower". it just compare 2 strings without taking care of the case.
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Hi.. Use _tcsicmp
Hi.. I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++ manju
manju#123 wrote:
Use _tcsicmp
_tcsicmp
does a lexicographic comparison between strings. It cannot convert between upper and lower cases. In short, it does some kind of comparison and the OP's requirement is to do some kind of conversion. :)Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
sumit.durg wrote:
Can any body tell me how to convert UPPER case string to lower case string in Unicode.
CString has the MakeUpper() and MakeLower() functions, but you need to understand that upper case and lower case exists only in English (and may be in those languages that uses English script). It is not a very good idea to make this call on a language like Hindi. I believe you understand it.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
For other languages, could be it done just adding or decreasing the "letter value" by 34 (or whatever value that gives "A" - "a")? Missunderstood of previous answer
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
-
For other languages, could be it done just adding or decreasing the "letter value" by 34 (or whatever value that gives "A" - "a")? Missunderstood of previous answer
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
and what about the language which havent uppercase and lowercase?
-
For other languages, could be it done just adding or decreasing the "letter value" by 34 (or whatever value that gives "A" - "a")? Missunderstood of previous answer
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
I am talking about those languages which has no UPPER or lower cases. It just would not mean anything do a conversion in that case. I also mentioned "Hindi", in my previous post, as an example.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
I am talking about those languages which has no UPPER or lower cases. It just would not mean anything do a conversion in that case. I also mentioned "Hindi", in my previous post, as an example.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
Sorry, I missunderstood you :-O :rolleyes:
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
-
sumit.durg wrote:
Can any body tell me how to convert UPPER case string to lower case string in Unicode.
CString has the MakeUpper() and MakeLower() functions, but you need to understand that upper case and lower case exists only in English (and may be in those languages that uses English script). It is not a very good idea to make this call on a language like Hindi. I believe you understand it.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
Exactly, Some language do not have upper and lower case.They have only one type as you said in hindi. I agree. But i need to convert Russian language. They have upper and lower case and MakeLower / _tcslwr in not working on russian. Do you have any other solution.
-
Sorry, I missunderstood you :-O :rolleyes:
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
No worries. :)
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Exactly, Some language do not have upper and lower case.They have only one type as you said in hindi. I agree. But i need to convert Russian language. They have upper and lower case and MakeLower / _tcslwr in not working on russian. Do you have any other solution.
Yes, I tested with CString::MakeLower() and it isn't working! Fortunately for you, it shouldn't be a daunting task to write your own mapping routine, because there are not too many characters in Russian language. Imagine writing a conversion routine for something like Chinese, if it had UPPER/lower cases! :)
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Exactly, Some language do not have upper and lower case.They have only one type as you said in hindi. I agree. But i need to convert Russian language. They have upper and lower case and MakeLower / _tcslwr in not working on russian. Do you have any other solution.
sumit.durg wrote:
But i need to convert Russian language.