2

I would like to type characters in "ISO 8859-1" CharacterCode:

"ž","'","´","é","é","ß","","ș","ë","ı","é","í","ó"

I am not able to do.

On the bottom of AndroidStudio I can switch the code :

enter image description here

I can switch and type some special characters and it looks good:

"ž","'","´","é","é","ß","","ș","ë","ı","é","í","ó"

I save , but after restarting AndroidStudio all characters are lost again and on the bottom there is UTF-8 again.

"�","�","�","�","�","�","?","?","'","�","�","�","�","�"

How can I set my file to be "ISO 8859-1" forever ?

My .idea/encodings.xml looks :

<file url="file://$PROJECT_DIR$/.../_TESTCLASS.java" charset="ISO-8859-1" />

but it seems to be ignored every time.

Can someone please help me ?

UPDATE Saving these characters in UTF-8 looks fine in the first look, but see how it is stored:

enter image description here

I need it as follow (This File i managed to set to ISO 8859-1:

enter image description here

mcfly soft
  • 11,289
  • 26
  • 98
  • 202
  • May I ask why don't you just use UTF-8? – Gergely Kőrössy Mar 24 '17 at 15:49
  • Because I can only store theese special characters in ISO-8859-1 . See in my question the questionmark characters. I really need this. Why can I choose the characterset , when its rollbacked everytime ? – mcfly soft Mar 24 '17 at 15:51
  • UTF-8 can store these chars without a hassle. Change the file's encoding to UTF-8, then insert these chars, and save it. Try opening the file with a different editor (like Notepad++ or even classic notepad should work) to check whether it was saved correctly. – Gergely Kőrössy Mar 24 '17 at 15:54
  • Thanks for helping, but I would be happy if someone can answer "my" question. I updated my question. There you see, that it is not the same. Comparing characters from a webstream is important to have characters in ISO - ..... for me. Please see. I need really ISO-8859-1. – mcfly soft Mar 24 '17 at 16:09
  • Check out [this SO answer](http://stackoverflow.com/a/229022) for a similar question. It's about conversion of chars to different charsets. – Gergely Kőrössy Mar 24 '17 at 16:13
  • My question is, how to save a file in different charactercode in AndroidStudio, thats all. I need no other help. Can please someone help me on this. Or in ohter words. For what is the setting at the bottom of AndroidStudio, when I can't change it. I simply need to change it. – mcfly soft Mar 24 '17 at 16:18
  • I understand that, but the approach you chose is error-prone and not really future proof, so I'd advise against it. – Gergely Kőrössy Mar 24 '17 at 16:22
  • My app is running 4 Years productiv (thousands of installations) without problems. (Eclipse Dev.) I guess thats the proove it was a stable solution. Now migrated to AndroidStudio and I have problems with simple Characterencoding. Why not just try to help me in that what I want and not drifting away to other solutions. I can't understand that. Why do we have a plattform for asking and in the end the questioner has to answer questions. – mcfly soft Mar 24 '17 at 16:26
  • My Simple Question is. Can I save a file in another character set in AndroidStudio ? Answer can be : no. Or the way howto do. It does not matter, if the questioner is stupid or not. It would simply answer the question. – mcfly soft Mar 24 '17 at 16:29

1 Answers1

0

You should try changing the default encoding to ISO 8859-1.

File -> Other Settings -> Default Settings, then find "File Encodings", change Project Encoding to ISO 8859-1.

  • 1
    Thanks a lot. It helped me partly. I had to switch as you said and then I had to delete all the files again and create the files again. Then it persisted to ISO-8859-1. Thanks a lot. – mcfly soft Mar 24 '17 at 16:40