Hello,
I want to read text from text area of jsp page and write its contents to a text file which is at server side.While doing this contents are get written into the file at server side file but its encoding get changed to another form. My text area contains some marathi text. english text gets written properly.Problem is only for marathi text.
I am using tomcat4.1.
Following is my code ...
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page import="java.io.*"%>
<%@ page import="java.net.URL" %>
<%
//String strName = request.getParameter("name");
String msg = request.getParameter("txtaTest");
String func = request.getParameter("func");
System.out.println("func->"+func);
try{
if(func!=null){
String strPath = "/home/ignu/dineshCpp/tomcat/apache-tomcat-4.1.34-LE-jdk14/temp/outFile1.txt";
File strFile = new File(strPath);
Writer objWriter = new BufferedWriter(new FileWriter(strFile));
// objWriter.write(strName );
objWriter.write("\n");
objWriter.write(msg );
objWriter.write("\n");
objWriter.flush();
objWriter.close();
}
}catch(Exception e){}
%>
<body>
<b>**********************INPUT FILE SAVED****************
<P>
<b>TO DOWNLOAD FILE CLICK HERE:-
</body>
</html>