How to Convert a File to UTF-8
Unicode Transformation Format 8 (UTF-8) is an encoding scheme that allows applications to properly display complex characters such as Japanese kanji or currency symbols. Many people use UTF-8 encoding to send and receive non-English email messages. Because of its flexibility, many developers prefer to use UTF-8 to create cross-platform applications and design commercial websites. If you wish to convert files to UTF-8, use Notepad or any plain text editor that supports Unicode. You may also use Windows PowerShell to rewrite files using UTF-8 encoding.
Instructions
-
Converting a Text File to UTF-8 Using Notepad
-
1
Launch Notepad and open the text file that you wish to convert.
-
2
Open the "File" menu and choose "Save As."
-
-
3
Enter your preferred file name. Click the drop-down menu beside "Encoding" and then choose "UTF-8." Click the "Save" button.
Converting Any File to UTF-8 Using Windows PowerShell
-
4
Download and install the latest version of Windows PowerShell.
-
5
Take note of the exact location of the file that you wish to convert. Obtain this easily by holding down "Shift" and right-clicking the file's icon in Windows Explorer. Choose "Copy as path" from the context menu and then paste this information in Notepad.
-
6
Hold down the Windows key and then press "R." Type "powershell" and then press "Enter." This opens Windows PowerShell.
-
7
Type the following code at the prompt. Replace "C:\scripts\yourfile.dat" with the exact location of the file that you wish to convert. Be sure to enclose it in quotation marks. Press "Enter" when you're done.
$mypath = "C:\scripts\yourfile.dat"
-
8
Type the following code at the next prompt and then press "Enter."
get-content -path $mypath | out-file $mypath -encoding utf8
-
1
Tips & Warnings
Windows 7 computers already have PowerShell 2.0 installed. To check if you have it on your computer, open the command prompt and then type "powershell."
References
Resources
- Photo Credit Ablestock.com/AbleStock.com/Getty Images