>
> Why are you using FileOutputStream AND OutputStreamWriter AND 
> BufferedWriter?  

 

I need the OutputStreamWriter to specify the encoding, however that doesn't 
seem to work...

What is the type of result? How did you put content in it? 
>
The result is a CSV file, I just loop over some DB records and build a 
string, then I write the string to the writer... 

> You are not checking the returnvalue of your write statement.  

the Writer.write(..) method does not return anything... it's void...!

 Please explain exactly what is wrong with it.

I thought I did, but anyway, I'll do it again:
Very simplistic explained: so in the application text (that the user 
enters) is stored in a DB, I read the contents of the DB and construct a 
string. Then I write the string in the writer (to the file)!
So when I do so for Dutch, German, English, Frensh,... (all western 
languages) it works. However users started reporting that when inputting 
Chinese or Hebrew characters the application works just fine but for the 
export the content of the CSV file is unreadable. You can open the CSV file 
in a text-editor or a spreadsheet editor but the characters that should be 
Chinese or Hebrew are just unreadable characters.

So instead of seeing something like this:
這是一個測試
I see something like this:
â €å”€å”€å”€à €à €à €ç¼€ç¼€ç¼€ç¼€ç¼€ç¼€ç¼€Ì€Ì€Ì€Ì€Ì€Ì€

So it's a matter of encoding that is not correct. But I am encoding in 
UTF-8 so I don't see the issue...

Kr,

Dirk



Op donderdag 29 maart 2012 11:35:37 UTC+2 schreef Remote Red het volgende:
>
>
>
>
> >     out = new BufferedWriter(new OutputStreamWriter( 
> > new FileOutputStream(file), "UTF-8" 
> >     )); 
>
> Why are you using FileOutputStream AND OutputStreamWriter AND 
> BufferedWriter? 
>
> >     out.write(result.toString()); 
>
> What is the type of result? How did you put content in it? 
>
> You are not checking the returnvalue of your write statement. 
>
> > I indeed see that the text is not correct. 
>
> Please explain exactly what is wrong with it.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to