Ironruby: ask how to execute the BAT file after correctly displaying UTF-8 characters in the DOS window?

Source: Internet
Author: User
Tags netbeans
ArticleDirectory
    • Solution
    • Displayed correctly after resolution
    • Legacy problems

InIronruby-write automated test scriptsThe result displayed in netbeans is correct, and garbled characters are displayed in DOS, as shown in:

In actual application, an automated test is performed on a bat file, instead of under netbeans, which is obviously a text encoding problem. What settings should I have to set to display Chinese Characters in DOS. I introduced the UTF-8 format used by ruby files in the ironruby-file encoding, So I collected an article on how to display UTF-8 characters in the DOS window and found a solution.

Solution

The following describes how to set the DOS window to display UTF-8 characters.

    1. Open the cmd.exe command line window.
    2. Change by using the chcp commandCodePage, UTF-8 code page is 65001
      Chcp 65001
    3. After this operation is performed, the code page is turned into a UTF-8. However, you also need to modify the font of window properties to correctly display UTF-8 characters, right-click on the command line title bar, choose [properties]-[font ], change the font to the true type font lucida console and click OK to apply the property to the current window. You can keep this setting so that you do not need to set it next time.
    4. After the above operations, the displayed content may be incomplete. In this case, we can minimize the number and then maximize the command line window.
Displayed correctly after resolution

After the modification, execute ironruby-when you compile the calculator automation script in the automation test script, it is displayed as follows:

Legacy problems

Although it is correctly displayed, after setting it, double-clicking the BAT file or executing the BAT file in the CMD window does not respond. No one knows how to solve this problem?

Lostinyoureyes provides the following solutions:Chcp 65001> NUL & ir.exe-ku-X: showclrexceptions testcalc. RB & pause

 

You are welcome to reprint it. Please note: Reprinted fromZhou jingen [http://zhoujg.cnblogs.com/]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.