File was loaded in the wrong encoding utf 8 как исправить

Before asking the question, I searched for a similar question on StackOverflow: file was loaded in the wrong encoding: 'UTF-8' in android studio But it did not give an explicit answer the...

Before asking the question, I searched for a similar question on StackOverflow:

file was loaded in the wrong encoding: ‘UTF-8’ in android studio

But it did not give an explicit answer there.


My issue is that the project is downloaded from the network, and it is an eclipse project, I open it with IntelliJ IDEA, and get this issue:

enter image description here

GiovanyMoreno's user avatar

asked Apr 1, 2017 at 6:43

qg_java_17137's user avatar

qg_java_17137qg_java_17137

3,56210 gold badges40 silver badges77 bronze badges

5

As Tarik point out, click the Reload in another encoding, and if you want UTF-8 encoding, then click the more -> UTF-8.

answered Apr 1, 2017 at 6:53

aircraft's user avatar

3

in my case , when i uploaded the first .ttf file in assert folder , android studio asked me to choose one file type , and when I selected text type . this problem start to appear .
the right file type is : ‘Files Opened In Associated Applications’.
to fix your problem , you have to open preferences ->Editor ->File Types and search for .ttf extension then remove it and add it again under ‘Files Opened In Associated Applications’
enter image description here

enter image description here

answered Nov 20, 2017 at 16:32

soufien karray's user avatar

1

I was having the same problem..
and i solved it by changing the CR to CRLF
AND then refresh the project
like done in following image

CHOOSE CRLF (image)

Machavity's user avatar

Machavity

30.5k27 gold badges90 silver badges100 bronze badges

answered Jan 29, 2019 at 6:00

Dinesh Sarma's user avatar

0

You can try opening your file with an other text editor, like Notepad++. Sometimes it can detect the correct encoding of your file, using a different pattern than IntelliJ.
Then you will be able to use the «Reload…» of IntelliJ.

answered Mar 14, 2018 at 14:36

Rodjf's user avatar

RodjfRodjf

1371 silver badge12 bronze badges

Click on setting symbol just right side of error and select suppress for class.
That works for me and resolve my issue.

answered Sep 22, 2017 at 6:13

Umesh Sonawane's user avatar

My colleague works on Windows while I work on Ubuntu 16.04

Click the Reload in another encoding, and click the more -> GBK.

Then we can see the Chinese character.

answered Jun 9, 2018 at 6:07

Francis Bacon's user avatar

Francis BaconFrancis Bacon

3,6401 gold badge34 silver badges46 bronze badges

I tried all possibilities posted here but any success with them, what worked was just to re import the project

answered Feb 5, 2020 at 15:39

Jimmy Alvarez's user avatar

Jimmy AlvarezJimmy Alvarez

5771 gold badge5 silver badges13 bronze badges

Though the encoding setting was present in the pom.xml, IntelliJ was trying to load all test files using UTF-8 instead of ISO-8859-1, so I found this in the IntelliJ docs: Encoding in IntelliJ
Which, it basically was…

  1. Open preferences (in macOS hit, command + ,)
  2. Go to Editor / File Encodings
  3. Select the project correct encoding if it defers from your pom.xml - project.build.sourceEncoding
    print from File Encodings IntelliJ

By doing so, it did stop asking me to reload the file with the correct encoding.

answered Apr 6, 2021 at 22:01

s_bighead's user avatar

s_bigheads_bighead

91911 silver badges24 bronze badges

If you have previously loaded this file without problems, and this is a new issue for you, try invalidating the caches in your IDE.

An easy way to open this option is by opening the super-search functionality (hit shift twice) and search for ‘cache’ in the ‘actions’ tab.

enter image description here

When prompted, choose the following option:

enter image description here

answered Aug 12, 2022 at 11:04

ninjaPixel's user avatar

ninjaPixelninjaPixel

5,9183 gold badges36 silver badges47 bronze badges

Before asking the question, I searched for a similar question on StackOverflow:

file was loaded in the wrong encoding: ‘UTF-8’ in android studio

But it did not give an explicit answer there.


My issue is that the project is downloaded from the network, and it is an eclipse project, I open it with IntelliJ IDEA, and get this issue:

enter image description here

GiovanyMoreno's user avatar

asked Apr 1, 2017 at 6:43

qg_java_17137's user avatar

qg_java_17137qg_java_17137

3,56210 gold badges40 silver badges77 bronze badges

5

As Tarik point out, click the Reload in another encoding, and if you want UTF-8 encoding, then click the more -> UTF-8.

answered Apr 1, 2017 at 6:53

aircraft's user avatar

3

in my case , when i uploaded the first .ttf file in assert folder , android studio asked me to choose one file type , and when I selected text type . this problem start to appear .
the right file type is : ‘Files Opened In Associated Applications’.
to fix your problem , you have to open preferences ->Editor ->File Types and search for .ttf extension then remove it and add it again under ‘Files Opened In Associated Applications’
enter image description here

enter image description here

answered Nov 20, 2017 at 16:32

soufien karray's user avatar

1

I was having the same problem..
and i solved it by changing the CR to CRLF
AND then refresh the project
like done in following image

CHOOSE CRLF (image)

Machavity's user avatar

Machavity

30.5k27 gold badges90 silver badges100 bronze badges

answered Jan 29, 2019 at 6:00

Dinesh Sarma's user avatar

0

You can try opening your file with an other text editor, like Notepad++. Sometimes it can detect the correct encoding of your file, using a different pattern than IntelliJ.
Then you will be able to use the «Reload…» of IntelliJ.

answered Mar 14, 2018 at 14:36

Rodjf's user avatar

RodjfRodjf

1371 silver badge12 bronze badges

Click on setting symbol just right side of error and select suppress for class.
That works for me and resolve my issue.

answered Sep 22, 2017 at 6:13

Umesh Sonawane's user avatar

My colleague works on Windows while I work on Ubuntu 16.04

Click the Reload in another encoding, and click the more -> GBK.

Then we can see the Chinese character.

answered Jun 9, 2018 at 6:07

Francis Bacon's user avatar

Francis BaconFrancis Bacon

3,6401 gold badge34 silver badges46 bronze badges

I tried all possibilities posted here but any success with them, what worked was just to re import the project

answered Feb 5, 2020 at 15:39

Jimmy Alvarez's user avatar

Jimmy AlvarezJimmy Alvarez

5771 gold badge5 silver badges13 bronze badges

Though the encoding setting was present in the pom.xml, IntelliJ was trying to load all test files using UTF-8 instead of ISO-8859-1, so I found this in the IntelliJ docs: Encoding in IntelliJ
Which, it basically was…

  1. Open preferences (in macOS hit, command + ,)
  2. Go to Editor / File Encodings
  3. Select the project correct encoding if it defers from your pom.xml - project.build.sourceEncoding
    print from File Encodings IntelliJ

By doing so, it did stop asking me to reload the file with the correct encoding.

answered Apr 6, 2021 at 22:01

s_bighead's user avatar

s_bigheads_bighead

91911 silver badges24 bronze badges

If you have previously loaded this file without problems, and this is a new issue for you, try invalidating the caches in your IDE.

An easy way to open this option is by opening the super-search functionality (hit shift twice) and search for ‘cache’ in the ‘actions’ tab.

enter image description here

When prompted, choose the following option:

enter image description here

answered Aug 12, 2022 at 11:04

ninjaPixel's user avatar

ninjaPixelninjaPixel

5,9183 gold badges36 silver badges47 bronze badges

Before asking the question, I searched for a similar question on StackOverflow:

file was loaded in the wrong encoding: ‘UTF-8’ in android studio

But it did not give an explicit answer there.


My issue is that the project is downloaded from the network, and it is an eclipse project, I open it with IntelliJ IDEA, and get this issue:

enter image description here

GiovanyMoreno's user avatar

asked Apr 1, 2017 at 6:43

qg_java_17137's user avatar

qg_java_17137qg_java_17137

3,56210 gold badges40 silver badges77 bronze badges

5

As Tarik point out, click the Reload in another encoding, and if you want UTF-8 encoding, then click the more -> UTF-8.

answered Apr 1, 2017 at 6:53

aircraft's user avatar

3

in my case , when i uploaded the first .ttf file in assert folder , android studio asked me to choose one file type , and when I selected text type . this problem start to appear .
the right file type is : ‘Files Opened In Associated Applications’.
to fix your problem , you have to open preferences ->Editor ->File Types and search for .ttf extension then remove it and add it again under ‘Files Opened In Associated Applications’
enter image description here

enter image description here

answered Nov 20, 2017 at 16:32

soufien karray's user avatar

1

I was having the same problem..
and i solved it by changing the CR to CRLF
AND then refresh the project
like done in following image

CHOOSE CRLF (image)

Machavity's user avatar

Machavity

30.5k27 gold badges90 silver badges100 bronze badges

answered Jan 29, 2019 at 6:00

Dinesh Sarma's user avatar

0

You can try opening your file with an other text editor, like Notepad++. Sometimes it can detect the correct encoding of your file, using a different pattern than IntelliJ.
Then you will be able to use the «Reload…» of IntelliJ.

answered Mar 14, 2018 at 14:36

Rodjf's user avatar

RodjfRodjf

1371 silver badge12 bronze badges

Click on setting symbol just right side of error and select suppress for class.
That works for me and resolve my issue.

answered Sep 22, 2017 at 6:13

Umesh Sonawane's user avatar

My colleague works on Windows while I work on Ubuntu 16.04

Click the Reload in another encoding, and click the more -> GBK.

Then we can see the Chinese character.

answered Jun 9, 2018 at 6:07

Francis Bacon's user avatar

Francis BaconFrancis Bacon

3,6401 gold badge34 silver badges46 bronze badges

I tried all possibilities posted here but any success with them, what worked was just to re import the project

answered Feb 5, 2020 at 15:39

Jimmy Alvarez's user avatar

Jimmy AlvarezJimmy Alvarez

5771 gold badge5 silver badges13 bronze badges

Though the encoding setting was present in the pom.xml, IntelliJ was trying to load all test files using UTF-8 instead of ISO-8859-1, so I found this in the IntelliJ docs: Encoding in IntelliJ
Which, it basically was…

  1. Open preferences (in macOS hit, command + ,)
  2. Go to Editor / File Encodings
  3. Select the project correct encoding if it defers from your pom.xml - project.build.sourceEncoding
    print from File Encodings IntelliJ

By doing so, it did stop asking me to reload the file with the correct encoding.

answered Apr 6, 2021 at 22:01

s_bighead's user avatar

s_bigheads_bighead

91911 silver badges24 bronze badges

If you have previously loaded this file without problems, and this is a new issue for you, try invalidating the caches in your IDE.

An easy way to open this option is by opening the super-search functionality (hit shift twice) and search for ‘cache’ in the ‘actions’ tab.

enter image description here

When prompted, choose the following option:

enter image description here

answered Aug 12, 2022 at 11:04

ninjaPixel's user avatar

ninjaPixelninjaPixel

5,9183 gold badges36 silver badges47 bronze badges

Skip to content


Sign up


  • In this repository


    All GitHub

  • No suggested jump to results

  • In this repository


    All GitHub


  • In this organization


    All GitHub


  • In this repository


    All GitHub

Sign in

Sign up

This repository has been archived by the owner on Jul 28, 2020. It is now read-only.


google-ar

/

sceneform-android-sdk

Public archive

  • Notifications

  • Fork
    608


  • Star
    1.2k


Closed

newmluser opened this issue

Aug 26, 2019

· 6 comments


Closed

File was loaded with the wrong encoding:UTF-8

#835

newmluser opened this issue

Aug 26, 2019

· 6 comments

Labels

bug

Something isn’t working

duplicate

This issue or pull request already exists

fixed in upcoming release

Comments

@newmluser



Copy link


newmluser

commented

Aug 26, 2019

I created a basic project and am trying to create SFA and SFB.

Added with a standard 3D obj and tried to create SFA and SFB.
Getting this Error. how can I fix this Error.
After this Error even the SFB is created in the assets folder I cannot open it

@bobekos



Copy link


bobekos

commented

Aug 27, 2019

Duplicate of #815

@newmluser



Copy link

Author


newmluser

commented

Aug 28, 2019

I have downgraded to ANdrios studio 3.4 and sceneform 1.11, I am still seeing the same issue that I cannot vew sfb. can some one help me in windows what are the versions I should use..

@nasko700



Copy link


nasko700

commented

Aug 28, 2019

I downgraded the plugin, but in AS 3.5 but I still have this problem.
Here are the versions of the plugin: https://plugins.jetbrains.com/plugin/10698-google-sceneform-tools-beta-/versions

@bobekos



Copy link


bobekos

commented

Aug 28, 2019

@newmluser
Ah ok. With AS 3.4 and Plugin 1.11 everything works correctly on my mac. The last version which i have tested on windows was 3.4 and 1.10.

@tpsiaki
tpsiaki

added

bug

Something isn’t working

fixed in upcoming release

labels

Aug 29, 2019

@tpsiaki



Copy link


Contributor


tpsiaki

commented

Aug 29, 2019

Thank you — I believe this is a dupe of #815 — we have a fix internally which will be available in our next release.

@tpsiaki
tpsiaki

added
the

duplicate

This issue or pull request already exists

label

Aug 29, 2019

@tpsiaki



Copy link


Contributor


tpsiaki

commented

Sep 13, 2019

This is fixed in the latest release

@tpsiaki
tpsiaki

closed this as completed

Sep 13, 2019

Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.

Assignees


No one assigned

Labels

bug

Something isn’t working

duplicate

This issue or pull request already exists

fixed in upcoming release

Projects


None yet

Milestone

No milestone

Development

No branches or pull requests

4 participants

@nasko700

@tpsiaki

@bobekos

@newmluser

Доброго времени суток
Помогите пожалуйста разобраться с проблемой

Суть такая.
Есть .txt файл в котором записаны строки в виде «{несколько слов} — {несколько слов}» (ну т.е. каждая строчка это как пара ключ-значение). Слова есть и русские и английские. В программе я считываю строки из этого файла и запихиваю их в мапу. Для этого использую вот такой метод:

Java
1
2
3
4
5
6
7
8
9
10
11
12
13
public Map<String, String> getDataFromFile() {
        Map<String, String> fileData = new HashMap<>();
        try {
            for (String line : Files.readAllLines(Paths.get("src\set.txt"))) {
                String key = line.split(" -- ")[0];
                String val = line.split(" -- ")[1];
                fileData.put(key, val);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return fileData;
    }

Ну и дальше работаю с этой мапой. Для ее хранения есть отдельный сериализуемый класс, чтобы при выключении программы сохранять состояние мапы если я там что-то изменил.

При закрытии программы вызывается метод

Java
1
2
3
4
5
6
7
8
public void serializeData() {
        try (FileOutputStream fileOutputStream = new FileOutputStream("src\data.dat");
             ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)){
            objectOutputStream.writeObject(data);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

При последующем запуске программы вызывается

Java
1
2
3
4
5
6
7
8
public void deserializeData() {
        try (FileInputStream fileInputStream = new FileInputStream("src\data.dat");
             ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream)) {
            data = (Data) objectInputStream.readObject();
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

Проблема вот в чем. При вызове serializeData() создается .dat файл в котором текст перемешан с левыми символами (стрелочками, квадратиками, вопросами и т.д.) и если просматривать его в IDEA сверху красным высвечивается » File was loaded in the wrong encoding: ‘UTF-8’ «. Несмотря на это, если запускать программу в IDEA, она все равно нормально отрабатывает, т.е. из полученной мапы можно спокойно доставать слова. Но вот если сделать .jar файл и запустить его, то ничего уже не работает.

Я вчера весь день пытался с этим разобраться, искал в интернете, пробовал различные решения, но ничего не помогло. Иногда из-за копания в настройках идеи так и вовсе все рушилось и вообще никакие коды из написанных ранее не запускались без ошибок. Может я тупой слишком, не знаю. Но в общем сегодня я решил попробовать спросить непосредственно о своей конкретной ситуации и конкретном коде. Помогите пожалуйста

П.С. У меня 10 винда и IntelliJ IDEA. В настройках кодировки идеи все три поля выставлены «UTF-8».

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

Понравилась статья? Поделить с друзьями:

Читайте также:

  • File transfer error 017 531
  • File system error or corruption
  • File system error 805305975
  • File system error 2147416359
  • File system error 2147219196

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии