NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; NSString *strSymbol = [locale objectForKey:NSLocaleCurrencySymbol]; NSLog(@"%@",strSymbol);
在测试Demo中可以正常显示人民币符号.
在项目中用NSLog输出也可以正常显示,但是在手机中测试只显示一横 (人命币符号是两横),帮我推测一下大概是什么原因
The one-horizontal and double-horizontal RMB symbols are
同一个字符
, which only correspond to同一个编码
in the coding table, but different fonts have different display effectsThe horizontal line is also the RMB symbol, but the fonts are different