How to encode to windows 1252 in Java while writing to the file? -


if encode data in windows-1252 format , write file, how set content type in java?

you can use outputstreamwriter.

writer out = new outputstreamwriter(new fileoutputstream(yourfile), "windows-1252"); 

use typical writer methods write output file (or wrap it, or declare outputstreamwriter).

the constructor accepts charset instead of string charset name. can so

charset windows1252 = charset.forname("windows-1252"); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -