Introduction

We had a few methods of writing text to a file. The method shown below is the most popular. It uses a method for writing which uses the java.io.FileWriter class. Note that this class has a constructor which can take two arguments. The filename and a Boolean. When you specify this as true, the FileWriter will append the ouput to the end of the file (if it exists already). You should give the full path to the file. On Windows you should escape the backslash (\), since it is the Java escape character. A file in Windows should therefore look like C:\\path\\to\\my\\file.txt. UNIX and Linux don’t need this. On Windows you can also use UNIX notation; e.g; C:/path/to/my/file.txt.

Introduction

UTF-8 I s a variable width character encoding capable of encoding all 1,112,064 valid code points in Unicode using one to four 8-bit bytes. The encoding is defined by the Unicode standard. When you want to write UTF-8 from your Application you can use the code below.