Here you can find the source of getEncoding(OutputStreamWriter inWriter)
Parameter | Description |
---|---|
inWriter | writer object |
public static String getEncoding(OutputStreamWriter inWriter)
//package com.java2s; //License from project: Open Source License import java.io.OutputStreamWriter; import java.nio.charset.Charset; public class Main { /**/*from ww w . ja v a2s . co m*/ * Get the default system encoding using a writer * @param inWriter writer object * @return string defining encoding */ public static String getEncoding(OutputStreamWriter inWriter) { String encoding = inWriter.getEncoding(); try { encoding = Charset.forName(encoding).name(); } catch (Exception e) { } // ignore failure to find encoding return encoding; } }