• Post Reply Bookmark Topic Watch Topic
  • New Topic

Extracting Japanese(kana) Charecters from a file  RSS feed

mou haj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help me??
I have a csv file or a fixed length txt file from where I'll have to capture some Kana Information and store them in a Database and also display them on a browser Im trying with this code but cant do it its displaying some junk
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.* ;
import java.lang.*;
import java.util.*;
public class showFile3 extends HttpServlet
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
}//end of doGet
public void init(ServletConfig config) throws ServletException
}//end of init
public void doPost (
HttpServletRequest request,
HttpServletResponse response
) throws ServletException, IOException
PrintWriter out = new java.io.PrintWriter(response.getOutputStream ());
int i;
String str;
String encodingType = "JISAutoDetect";
RandomAccessFile jpTextFile = new RandomAccessFile("d:\\filehandling\\kana.txt", "r");
byte[] fileBytes = new byte[20] ;
String fileString = null;
jpTextFile.read(fileBytes, 0, 15) ;
fileString = new String(fileBytes, encodingType);
out.println(" <META HTTP-EQUIV='Content-Type' Content='text/html; charset=x-sjis'></head><body>");
catch (Exception e)
System.err.println("File input error");
}//post ends
}//class ends
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!