I am working on an existing application which allows the user to submit a CSV file for upload. Post submit, the servlet uses MultipartRequest API to transfer the file to a location on the Unix server. Then an Oracle St Proc is called which traverses this file and inserts each row into a table.

Recently there was a change-request to support German and Japanese characters in the CSV file for upload. As CSV won't support these chars, the file was saved as "Unicode Text" type and below JAVA changes were made:

MultipartRequest multi = new MultipartRequest(request, "/tmp", 20000000, "UTF-8"); // UTF-8 was introduced to support the Unicode File type. This parameter was not used for CSV files before.

The file is being transferred to the destination, but the foreign chars and the regular chars are distorted with addition of unwanted chars. This was verified by doing a "vi" and "cat" in Unix. If this file is transferred back to Windows using WinSCP, the file looks ok. Also, the Oracle PL/SQ code is failing because of this distortion.

Hence below are my questions. Feel free to answer whatever you are aware of:
1. Can MultipartRequest support Unicode text files?
2. If yes, then do I have to modify the parameters in the above JAVA call?
3. Is there specific requirements on the Oracle side to handle such files? Below are the highlights of the current Oracle code.

v_linebuffer nVARCHAR2(1000);
f_handle := UTL_FILE.fopen_nchar('TMP_DIR',p_filename,'R');
UTL_FILE.GET_LINE_nchar(f_handle, v_linebuffer);

Personally, I feel that this is a complex approach and could have been simplified by allowing JAVA to handle the data and make insert requests to Oracle. But before making such design changes, I want to rule out any possible encoding/setting related fixes.

Any suggestions are appreciated.