0

I've ran into an issue yesterday while not changing any setting of the project or settings of the IDEA.

I'm using Android Studio, and every file I open gets "corrupted" in that it gets encoded into some format I don't recognize. Funny thing is notepad++ recognizes it and i can extract the original code from it (thank god, didn't have backup such as git).

Here is a screen shoot of what is happening:

Android Studio encoding problem photo

Haem
  • 929
  • 6
  • 15
  • 31
luka cagalj
  • 15
  • 1
  • 7
  • "was Loaded in wrong encoding", the error message says what is going wrong. Also, please don't put links to images, post it in your question, as actual text. – Stultuske Feb 21 '19 at 07:43
  • maybe this can help you out: https://stackoverflow.com/questions/43153703/file-was-loaded-in-the-wrong-encodingutf-8-in-intellij-idea – Stultuske Feb 21 '19 at 07:45
  • I can't post the image before i get 10 of something so keep that in min that i'm new – luka cagalj Feb 21 '19 at 08:05
  • you shouldn't post images, as I said, you should post the actual texts. – Stultuske Feb 21 '19 at 08:06
  • @Stultuske In this case, it really is a problem of how the IDE renders the code rather than the code itself, so a screenshot is appropriate. – Haem Feb 21 '19 at 08:10
  • @Haem the problem is encoding. just by copy pasting that error message an explanation can be provided. The IDE provides a suggestion itself 'Load in another encoding'. He should check the encoding of the file against the encoding expected/used by the IDE – Stultuske Feb 21 '19 at 08:13
  • Well i do know that and i've tried few of the encoding types neither of them helped. That's why i event screen shooted all the encoding types which are marked with red exclamation mark which logically means there are some issues with all those types, the ones that have yellow exclamation mark are not working aswell Also i've put line separator to CRLF instead of CR and now i don't get error that it's encoded wrong but i only see wierd letters basically i removed the red label statement of error and the problem didnt solve – luka cagalj Feb 21 '19 at 08:17
  • If Notepad++ can open it correctly, can't you just check in Notepad++ what the actual encoding is? – Thomas Feb 21 '19 at 08:28
  • Once i copy the text to notepad++ it displays it as normal characters i don't have idea how can i check the encoding? – luka cagalj Feb 21 '19 at 08:52

1 Answers1

1

If you are able to open the file in Notepad++, the status bar in the bottom of the window has the encoding in the third cell from the right, between the bit that says INS or OVR and the one that indicates the newline mode, e.g. Windows (CR LF), Unix (LF) or Macintosh (CR).

Haem
  • 929
  • 6
  • 15
  • 31