How to put Hebrew character in Android JAVA file?

2019-05-20 23:39发布

For Android Platform:

I need to put Hebrew Character ₪ and some more like אורנג in string to check with the incoming data in java file. When I put this character It shows an error like "Some characters can not be mapped using "Cp1252" character encoding. Either change the encoding or remove the characters which are not supported by the "Cp1252" character encoding". These values are coming from SQLite database. Please see the attached snap. How can I solve this? Kindly give me some useful suggestions. Looking forward to hear from anybody who has a suggestion for me. Thanks.ErrorSnap

3条回答
Root(大扎)
2楼-- · 2019-05-21 00:07

Please open your eclipse.ini file from your eclipse folder with Note Pad and put the following permission into that. -Dfile.encoding = UTF-8

Some more options as well:

  1. For setting the encoding on a per WorkSpace basis, use Preferences->General->Workspace

  2. To set the encoding on a per project basis open project properties and change to UTF-8

Hope this one help.

查看更多
该账号已被封号
3楼-- · 2019-05-21 00:09

I think this may useful to you. Keep this hebrew word in string.xml file. You can retrieve as in String.xml place hebrew word here In java code: String s=getString(R.string.hebrew_word); Use this string as you want..

查看更多
聊天终结者
4楼-- · 2019-05-21 00:33

I think you'll need UTF-8 encoding for that.

These things are a little bit confusing. Reading this might clear some of the mist around encodings and character sets.

查看更多
登录 后发表回答