Let Windows create a new UTF-8 encoded text file

Source: Internet
Author: User

It's always been a way to create a new code file with a new text file, right-click, but there's a problem. The newly created file is 0 bytes in size. For file files that are 0 bytes in size, the text editor generally uses MBCS encoding, and MBCS encoding is not good for cross-system, cross-editor use of files.

First look at the Windows system "right-click New" mechanism.

1. Open the Registration form

2. Expand HKEY_CLASSES_ROOT

3. Find the. txt subkey, expand it, and the secret is to shellnew this subkey. All extensions with Shellnew subkeys will appear in the New Right-click menu

4. Click the Shellnew subkey, and in the right jack there is a string value filename, extension string value itemname. The following on my machine:

Explain the specific meanings of these two values:

1. FileName the template file for the new file, which is in the @%systemroot%\shellnew directory. All new text files are copies of the Newtext.txt.

2. ItemName the name of the new menu item "Right-click," Notepad.exe the value of the No. 470 string resource, as follows:

Small partners should have thought of how to achieve the requirements of the topic.

1. Open the Newtext.txt file with Notepad, and users in Vista and above remember to run Notepad using administrator mode

2. Click on the Notepad menu "file-Save as"

3. In the "Encode (E)" option, select UTF-8 and click "OK"

4. Get it done and try it quickly.

Like to toss a small partner can also try to modify the contents of the Newtext.txt file.

Original address: http://www.jianshu.com/p/e956eaae8828

Let Windows create a new UTF-8 encoded text file

Related Article

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.