import java.io.BufferedWriter; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class UTF8Example { public static void main(String args[]) throws Exception{ //Getting the Path object Path path = Paths.get("D:\\samplefile.txt"); //Creating a BufferedWriter object BufferedWriter writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8); //Appending the UTF-8 String to the file writer.append("టుటోరియల్స్ పాయింట్ కి స్వాగతిం"); //Flushing data to the file writer.flush(); System.out.println("Data entered into the file"); } }