How to Force UTF-8 in Unix
UNIX is a multi-user, multi-tasking operating system based on the C programming language and was originally developed by AT&T. It uses a hierarchical file system and plain text for storing files. When it comes to string objects, Unicode is used to encode the data. There are various formats of Unicode, such as UTF-8 or UTF-16. In order to work on the UNIX system, the string object must be converted to the UTF-8 format.
Instructions
-
-
1
Click "Start" and double-click "Notepad" to launch your text/HTML editor. Click "File" and then click "New."
-
2
Type "import java.lang.*;" and press "Enter."
-
-
3
Create an array to hold the forced UTF-8 by typing the following code and then press "Enter":
byte[] utf8Result;
-
4
Force the conversion to UTF-8 by typing the following code and then pressing "Enter":
utf8Result = myString.getBytes("UTF-8");
Replace "myString" with the name of the string you want to force to UTF-8. Your string will be converted to UTF-8.
-
1