Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to conversion from upper case string to lower case in MFC.

How to conversion from upper case string to lower case in MFC.

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
14 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M manju 123

    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

    T Offline
    T Offline
    toxcct
    wrote on last edited by
    #5

    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]

    1 Reply Last reply
    0
    • M manju 123

      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

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #6

      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

      1 Reply Last reply
      0
      • R Rajesh R Subramanian

        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

        N Offline
        N Offline
        Nelek
        wrote on last edited by
        #7

        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

        M R 2 Replies Last reply
        0
        • N Nelek

          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

          M Offline
          M Offline
          Maxim Zarus
          wrote on last edited by
          #8

          and what about the language which havent uppercase and lowercase?

          1 Reply Last reply
          0
          • N Nelek

            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

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #9

            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

            N 1 Reply Last reply
            0
            • R Rajesh R Subramanian

              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

              N Offline
              N Offline
              Nelek
              wrote on last edited by
              #10

              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

              R 1 Reply Last reply
              0
              • R Rajesh R Subramanian

                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

                S Offline
                S Offline
                sumit durg
                wrote on last edited by
                #11

                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.

                R N 2 Replies Last reply
                0
                • N Nelek

                  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

                  R Offline
                  R Offline
                  Rajesh R Subramanian
                  wrote on last edited by
                  #12

                  No worries. :)

                  Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                  1 Reply Last reply
                  0
                  • S sumit durg

                    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.

                    R Offline
                    R Offline
                    Rajesh R Subramanian
                    wrote on last edited by
                    #13

                    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

                    1 Reply Last reply
                    0
                    • S sumit durg

                      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.

                      N Offline
                      N Offline
                      Nemanja Trifunovic
                      wrote on last edited by
                      #14

                      sumit.durg wrote:

                      But i need to convert Russian language.

                      Here is the table[^]

                      Programming Blog utf8-cpp

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups