0

Its been a while when I open android studio I always get weird texts instead of the real file, like if I open a java file or xml, some of them would show me something different than the actual file looks like, and if I open the file manually from file explorer using notepad I find the original one, and it keep happening.

Êþº¾   4X
SUV %abc_action_bar_content_inset_material I 
ConstantValue   %abc_action_bar_content_inset_with_nav  &abc_action_bar_default_height_material  +abc_action_bar_default_padding_end_material  -abc_action_bar_default_padding_start_material  !abc_action_bar_elevation_material  -abc_action_bar_icon_vertical_padding_material  ,abc_action_bar_overflow_padding_end_material  .abc_action_bar_overflow_padding_start_material  !abc_action_bar_stacked_max_height    $abc_action_bar_stacked_tab_max_width 
.abc_action_bar_subtitle_bottom_margin_material  +abc_action_bar_subtitle_

and most of the time its text weirder than that and cant be read. if i run the application it will work just fine though.

FYI this file is gradle project

this is xml file.. this is not the one i wrote but if open it in file explorer it will be different.

"logs": [
    {
        "outputFile": "C:\\Users\\saadm\\OneDrive\\Desktop\\flowers\\app\\build\\intermediates\\incremental\\mergeDebugResources\\merged.dir\\values-en-rCA\\values-en-rCA.xml",
        "map": [
            {
                "source": "D:\\Users\\saadm\\.gradle\\caches\\transforms-2\\files-2.1\\331630a23dfa1f0594bcf54d5352aa36\\core-1.1.0\\res\\values-en-rCA\\values-en-rCA.xml",
                "from": {
                    "startLines": "2",
                    "startColumns": "4",
Saad Malhas
  • 19
  • 1
  • 10

1 Answers1

1

It’s possible that you are using a non-unicode file and android studio does not know what the encoding is (like cp1256).

Notepad knows it is a windows-1256 (I am just guessing the code page) because you have already told it in Region and Language section of your Control Panel in Locale tab.

To convert your files into utf8 — so it would be opened in Android Studio in correct form — you may open it with notepad and save as it again as a text or whatever extension you ike, BUT change the target encoding to utf8.

The resulting file should be fine to view on Android Studio.

Iman Nia
  • 2,255
  • 2
  • 15
  • 35
  • yes what you are saying is right, and android studio sometimes asks me to change (windows-1256), but you suggested to change the encoding to utf8, i am expecting you meant to write on the first line of the file ( ) which already exists when i open it using notepad – Saad Malhas Feb 15 '20 at 18:17
  • Looks like there is already an answer for this but just by writing its encoding at the beginning of your xml file, the content of the file does not become magically that. You need to convert encoding by using save as in notepad or other applications like Notepad++ – Iman Nia Feb 15 '20 at 20:11