if (BaseApplication.isZh()) {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file), U.GB_2312)); // 支持中文描述或点名
} else {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file), U.UTF_8));// 其他语言以
}
// BaseApplication
public static boolean isZh() {
return LanguageUtil.isZh(mContext);
}
// LanguageUtil
public static boolean isZh(Context context) {
Locale locale = context.getResources().getConfiguration().locale;
String language = locale.getLanguage();
String country = locale.getCountry();
return language.endsWith("zh") && country.equals("CN");
}
网友评论