# Revision history [back]

Hi all,

I'm using zk 7 and I can't encode an uploaded csv file.

When I upload the file I get ? on special characters. Default encoding is set to UTF-8 and it's working fine when the file is encoded that way but when the file has no enconding I can't force it to UTF-8 because when I get the stream or byte array the ? are already there...

I've tried taking it as text:

<z:button label="${msg.backend.actions.upload}" upload="true,maxsize=-1,multiple=false" onUpload="@command('upload')" />  and as native: <z:button label="${msg.backend.actions.upload}" upload="true,maxsize=-1,multiple=false,**native**"


but I always get the same result: ? on special characters.

Java code:

(in = media.getByteData())

String utf8Data = new String(in, Charsets.UTF_8);

StringBuilder sb = new StringBuilder();
char[] buffer = new char[4096];
}
String utf8Data2 = new String(sb.toString().getBytes(Charsets.UTF_8));


Any ideas?

Many thanks.

Hi all,

I'm using zk 7 and I can't encode an uploaded csv file.

When I upload the file I get ? on special characters. Default encoding is set to UTF-8 and it's working fine when the file is encoded that way but when the file has no enconding I can't force it to UTF-8 because when I get the stream or byte array the ? are already there...

I've tried taking it as text:

<z:button label="${msg.backend.actions.upload}" upload="true,maxsize=-1,multiple=false" onUpload="@command('upload')" />  and as native: <z:button label="${msg.backend.actions.upload}" upload="true,maxsize=-1,multiple=false,**native**"


but I always get the same result: ? on special characters.

Java code:

(in = media.getByteData())

String utf8Data = new String(in, Charsets.UTF_8);

StringBuilder sb = new StringBuilder();
char[] buffer = new char[4096];
}
String utf8Data2 = new String(sb.toString().getBytes(Charsets.UTF_8));


Any ideas?

Many thanks.

Support Options
• Email Support
• Training
• Consulting
• Outsourcing