Forum Stats

  • 3,826,761 Users
  • 2,260,705 Discussions
  • 7,897,072 Comments

Discussions

garbage text

user575089
user575089 Member Posts: 466
edited Jun 23, 2017 1:21AM in Java Programming

I uploaded a file .  file name is in polish .  I'm receiving  garbage file name in java class during file upload.

Could you please tell how to fix this ?

I'm trying to save polish file name  in database. .. but now  garbage text is saved.

where to fix this so that polish text is received at java  and saved in db?

Database:SQL Server 2008

table column :nvarchar

please see the screencast :

https://www.dropbox.com/s/ibzm2ngpdzr36qp/Video_Test.wmv?dl=0

at video 1.16 => you see the received file name after file upload in java code. ....this is a garbage text.  //I  want to receive correct polish text file name.

at video 1.30 =>  you see the original polish text file.

Answers

  • user575089
    user575089 Member Posts: 466
    edited Jun 22, 2017 1:43PM

    any input to this ?

  • Unknown
    edited Jun 22, 2017 4:54PM

    You haven't posted any code or results in this forum that would allow anyone to provide specific help.

    Any 'garbage' you have is the result of using a difference character set that what the data actually is.

    So you need to use client and server character sets that are compatible with each other.

  • user575089
    user575089 Member Posts: 466
    edited Jun 23, 2017 1:21AM

    Could you please watch the dropbox link I posted ? ...... relevant code is there.

    rp0428 wrote:You haven't posted any code or results in this forum that would allow anyone to provide specific help.Any 'garbage' you have is the result of using a difference character set that what the data actually is.So you need to use client and server character sets that are compatible with each other.

    Did you watch the dropbox  video I posted ?  Could  you please watch it  .....that is the "result"  I am getting .

    regarding compatibility I  have the following code .

    in Server :

    -----------------

    request.setCharacterEncoding("UTF-8");

    in JSP page :

    -----------------

    <%@ page pageEncoding="UTF-8"%>

    <%@ page contentType="text/html;charset=utf-8"%>

    <html:form action="/s/planAdd" enctype="multipart/form-data"  styleId="planForm1"

      method="POST">

    I'm uploading file in jsp page .   file name is in polish characters.

    I'm getting garbage character in  server .  whats wrong ?

    I'm using Struts FormFile for file upload

This discussion has been closed.