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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Reading Simplified Chinese String. [modified]

Reading Simplified Chinese String. [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestion
12 Posts 3 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.
  • G gothic_coder

    Hello all. I'm again bringing up this problem because my last thread regarding this problem dissolves in lot's of thread here, Hoping to find answer this time. I am extracting the data in "Simplified Chinese" from database and writing the data into file(Notepad).. In other words i'm making many LAN Files from single database. It works well, I'm getting right data in LAN Files... Now the problem is that the project is pretty big and old applications are using GetPrivateProfileString to read from LAN files, But when they(applications) read "Simplified Chinese" LAN files they get Junk or question mark instead of Simplified Chinese characters.. Also when i tried reading and displaying using GetPrivateProfileStringW it works well but i cannot alter old applications code.. So my question is that, Is there any way i can read that data in simplified chinese using GetPrivateProfileString and able to display right data on GUI. P.S I make different LAN files using different language databases including "Traditional Chinese" and it works well, Only Simplified Chinese is creating problem. Thanks.

    modified on Friday, August 7, 2009 4:49 AM

    S Offline
    S Offline
    sashoalm
    wrote on last edited by
    #2

    It seems your old applications were ANSI. You should recompile them with UNICODE flag set instead.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    G 1 Reply Last reply
    0
    • S sashoalm

      It seems your old applications were ANSI. You should recompile them with UNICODE flag set instead.

      There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

      G Offline
      G Offline
      gothic_coder
      wrote on last edited by
      #3

      Thanks for your reply, Yes they are in ANSI But i simply cannot change anything..There's lot of dependency.. Whatever i can do is in my code(Database to LAN)..

      S 1 Reply Last reply
      0
      • G gothic_coder

        Thanks for your reply, Yes they are in ANSI But i simply cannot change anything..There's lot of dependency.. Whatever i can do is in my code(Database to LAN)..

        S Offline
        S Offline
        sashoalm
        wrote on last edited by
        #4

        I'm not sure if it really can be done, but try looking at the different code pages[^]. See GBK[^].

        There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

        G 1 Reply Last reply
        0
        • S sashoalm

          I'm not sure if it really can be done, but try looking at the different code pages[^]. See GBK[^].

          There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

          G Offline
          G Offline
          gothic_coder
          wrote on last edited by
          #5

          I tried int iReturn = _setmbcp(936); also... But no suuccess :( Anyone... Thanks.

          S 1 Reply Last reply
          0
          • G gothic_coder

            I tried int iReturn = _setmbcp(936); also... But no suuccess :( Anyone... Thanks.

            S Offline
            S Offline
            sashoalm
            wrote on last edited by
            #6

            gothic_coder wrote:

            iReturn = _setmbcp(936);

            I don't know what that is. Anyway, if you're program is ANSI how can you read Chinese Simplified? Isn't it supposed to need Unicode or at least MBCS or am I wrong?

            There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

            A G 2 Replies Last reply
            0
            • S sashoalm

              gothic_coder wrote:

              iReturn = _setmbcp(936);

              I don't know what that is. Anyway, if you're program is ANSI how can you read Chinese Simplified? Isn't it supposed to need Unicode or at least MBCS or am I wrong?

              There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

              A Offline
              A Offline
              Adam Roderick J
              wrote on last edited by
              #7

              Yes it will better to change the project setting with UNICODE support. ANSI characters only 256 they wont support any East Asian language.

              Величие не Бога может быть недооценена.

              S 1 Reply Last reply
              0
              • A Adam Roderick J

                Yes it will better to change the project setting with UNICODE support. ANSI characters only 256 they wont support any East Asian language.

                Величие не Бога может быть недооценена.

                S Offline
                S Offline
                sashoalm
                wrote on last edited by
                #8

                The OP says that Traditional Chinese works in his first post. P.S. I make different LAN files using different language databases including "Traditional Chinese" and it works well, Only Simplified Chinese is creating problem. I really don't get it how it can work with an ANSI program, but he seems to say that.

                There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

                G 1 Reply Last reply
                0
                • S sashoalm

                  gothic_coder wrote:

                  iReturn = _setmbcp(936);

                  I don't know what that is. Anyway, if you're program is ANSI how can you read Chinese Simplified? Isn't it supposed to need Unicode or at least MBCS or am I wrong?

                  There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

                  G Offline
                  G Offline
                  gothic_coder
                  wrote on last edited by
                  #9

                  My program is in UNICODE, and other applications(Which read from LAN) as i mentioned earlier were written long back and in ANSI... But when i make "Traditional Chinese" lan files the applications read the right data and i get right data in GUI.. I'm writing the unicoded data in the file(notepad) in my program... So isn't there any way for "Simplified Chinese". Thanks.

                  G 1 Reply Last reply
                  0
                  • S sashoalm

                    The OP says that Traditional Chinese works in his first post. P.S. I make different LAN files using different language databases including "Traditional Chinese" and it works well, Only Simplified Chinese is creating problem. I really don't get it how it can work with an ANSI program, but he seems to say that.

                    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

                    G Offline
                    G Offline
                    gothic_coder
                    wrote on last edited by
                    #10

                    Yes it work smoothly in "Traditional Chinese"... Trust me, Other applications which reads are ANSI based... I am really confused why it's not working in the case of "Simplified Chinese". Thanks.

                    1 Reply Last reply
                    0
                    • G gothic_coder

                      My program is in UNICODE, and other applications(Which read from LAN) as i mentioned earlier were written long back and in ANSI... But when i make "Traditional Chinese" lan files the applications read the right data and i get right data in GUI.. I'm writing the unicoded data in the file(notepad) in my program... So isn't there any way for "Simplified Chinese". Thanks.

                      G Offline
                      G Offline
                      gothic_coder
                      wrote on last edited by
                      #11

                      No one??

                      G 1 Reply Last reply
                      0
                      • G gothic_coder

                        No one??

                        G Offline
                        G Offline
                        gothic_coder
                        wrote on last edited by
                        #12

                        Also when i tried "Traditional Chinese" LAN files in "Simplified Chinese" operating system, It shows everything in English..I mean when i check LAN files it is in "Traditional Chinese" but when applications read from LAN files and display on GUI, it shows everything in English.. The OS is Windows7.. Also in Win XP, The application shows the mixture of right data and "?", It must mean that whatever application understand it shows it and for the rest it shows "?".. Thanks.

                        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