当前位置: 编程技术>移动开发
本页文章导读:
▪批改语言环境方法 修改语言环境方法
修改语言环境方法
private void setLocale(Locale locale) {
try {
IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
c.........
▪ 怎么读取GBK 如何读取GBK
NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
s = [[[NSString alloc] initWithData:data encoding:enc] autorelease];
把gbk转utf8,实际上有点误解,只不过默认编.........
▪ 长江水位查询天候查询 长江水位查询天气查询
汗,安卓市场我的程序挂不上去,算了。我打算挂在ITEYE上面啦。
长江水位查询,给水运人员,钓鱼爱好者,渔业工作者使用的。
......
[1]批改语言环境方法
来源: 互联网 发布时间: 2014-02-18
修改语言环境方法
修改语言环境方法
private void setLocale(Locale locale) { try { IActivityManager am = ActivityManagerNative.getDefault(); Configuration config = am.getConfiguration(); config.locale = locale; config.userSetLocale = true; am.updateConfiguration(config); } catch (RemoteException e) { } } setLocale(Locale.ENGLISH); //设置成英语 setLocale(new Locale("es_ES"));////设置成西班牙语 setLocale(Locale.SIMPLIFIED_CHINESE); //设置成简体中文 setLocale(Locale.KOREA);//设置成韩语 //获取语言环境 private static final int LAN_ENG = 0; private static final int LAN_ESP = 1; private static final int LAN_CHN = 2; private static final int LAN_KOR = 3; private int getLocaleId() { String languageCode = Locale.getDefault().getLanguage(); Log.e(TAG , languageCode); if (languageCode.equals("en")) return LAN_ENG; if (languageCode.equals("es_es")) return LAN_ESP; if (languageCode.equals("zh")) return LAN_CHN; if (languageCode.equals("ko")) return LAN_KOR; return -1; }
[2] 怎么读取GBK
来源: 互联网 发布时间: 2014-02-18
如何读取GBK
NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
s = [[[NSString alloc] initWithData:data encoding:enc] autorelease];
把gbk转utf8,实际上有点误解,只不过默认编码是utf8罢了。oc的默认编码集是没有utf8的,GBK(0x80000632)
enum { NSASCIIStringEncoding = 1, /* 0..127 only */ NSNEXTSTEPStringEncoding = 2, NSJapaneseEUCStringEncoding = 3, NSUTF8StringEncoding = 4, NSISOLatin1StringEncoding = 5, NSSymbolStringEncoding = 6, NSNonLossyASCIIStringEncoding = 7, NSShiftJISStringEncoding = 8, /* kCFStringEncodingDOSJapanese */ NSISOLatin2StringEncoding = 9, NSUnicodeStringEncoding = 10, NSWindowsCP1251StringEncoding = 11, /* Cyrillic; same as AdobeStandardCyrillic */ NSWindowsCP1252StringEncoding = 12, /* WinLatin1 */ NSWindowsCP1253StringEncoding = 13, /* Greek */ NSWindowsCP1254StringEncoding = 14, /* Turkish */ NSWindowsCP1250StringEncoding = 15, /* WinLatin2 */ NSISO2022JPStringEncoding = 21, /* ISO 2022 Japanese encoding for e-mail */ NSMacOSRomanStringEncoding = 30, NSUTF16StringEncoding = NSUnicodeStringEncoding, /* An alias for NSUnicodeStringEncoding */ NSUTF16BigEndianStringEncoding = 0x90000100, /* NSUTF16StringEncoding encoding with explicit endianness specified */ NSUTF16LittleEndianStringEncoding = 0x94000100, /* NSUTF16StringEncoding encoding with explicit endianness specified */ NSUTF32StringEncoding = 0x8c000100, NSUTF32BigEndianStringEncoding = 0x98000100, /* NSUTF32StringEncoding encoding with explicit endianness specified */ NSUTF32LittleEndianStringEncoding = 0x9c000100 /* NSUTF32StringEncoding encoding with explicit endianness specified */ }; typedef NSUInteger NSStringEncoding;
[3] 长江水位查询天候查询
来源: 互联网 发布时间: 2014-02-18
长江水位查询天气查询
汗,安卓市场我的程序挂不上去,算了。我打算挂在ITEYE上面啦。
长江水位查询,给水运人员,钓鱼爱好者,渔业工作者使用的。
最新技术文章: