Menu

Dev C++ unicode problem

2011-06-10
2012-09-26
  • Chengbin Zheng

    Chengbin Zheng - 2011-06-10

    I have set my system to display Chinese for non unicode programs. However,
    this wrecks havoc with DevC++ as some characters show up as strange chinese
    looking characters. How can I maintain my setting and have DevC++ working
    normally?

     
  • Jim Pattee

    Jim Pattee - 2011-06-11

    Where are the strange characters displayed? Are they in the source code
    listing or somewhere else?

     
  • Chengbin Zheng

    Chengbin Zheng - 2011-06-12

    When I use Dev C++ as an IDE (or text editor for that matter), some code would
    display as strange characters.

     
  • Jim Pattee

    Jim Pattee - 2011-06-14

    When you changed the system to display Chinese you should have changed both
    the user locale (Formats tab) and the system locale (Administrative tab) to
    Chinese.

    Assuming you did that you probably have have Chinese characters in your source
    code. To display them correctly you need to change the default Dev C++
    codepage to windows-936 (Chinese simplified) or windows-950 (Chinese
    traditional). This is the codepage for the file which is independent of the
    system setting. If that doesn't work try the unicode setting UTF-8.

    I don't have Dev-Cpp installed but there should be a "file encoding" option
    somewhere in the options.

     
  • Chengbin Zheng

    Chengbin Zheng - 2011-06-15

    I only changed the system locale to Chinese because I use an English version
    of Windows 7, and most of my programs are in English, just when I have one or
    two odd programs that are in Chinese I need Windows to display it.

    My code does not have Chinese characters. It is all English, yet these strange
    characters appear.

     
  • Jim Pattee

    Jim Pattee - 2011-06-15

    It sounds like the file encoding is not correct. If the code is all English
    the file may be UTF-16 encoding, or even utf-32 or utf-7.

    Can the encoding be changed with Dev-cpp? If it can, change it and try to find
    a code that displays correctly.

    If you can make the file available I can probably find the encoding.

     
  • Chengbin Zheng

    Chengbin Zheng - 2011-06-16
     
  • Jim Pattee

    Jim Pattee - 2011-06-16

    The problem is not file encoding. The quote marks on line 22 are not ascii
    quote marks, they are something else. I don't think the problem is Dev-C++.
    Your keyboard might not be entering the correct character. If you copied the
    code from somewhere that could be the problem.

    To correct it replace line 22 with:
    system("PAUSE");
    It should then compile.

    When the quote marks are entered correctly the "PAUSE" will be colored in the
    string color. The default color is red, but you might have changed that.

     
  • Chengbin Zheng

    Chengbin Zheng - 2011-06-16

    ahhhhhh, thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.