Android Studio Writing Bom's To Utf-8 File
Solution 1:
Remove BOM Didn't work for me.
It's the problem for the code I copied from a website.
I wrote it again and problem solved.
Solution 2:
It seems that this is a bug in IntellJ IDEA, on which Android Studio is based.
Try this:
- In Settings | File Encodings Select the "Projekt"-Entry with the mouse in the second column and choose "" (Confrim removal of Encodings set in subdirectories or choose the directories where you don't wan't a default-encoding enforced.)
- de-select "Autodetect UTF-encoded files"
- select "Transparent native-to-ascii conversion"
Another possible fix is to remove all BOMs outside Android studio (with hex editor or another text editor) and then choosing File -> Synchronize
in AS.
Solution 3:
In Android Studio "Project" pane, right-click on the file with BOM problem(s) and select: Analyze > Inspect Code. Then click OK. You will get a list of all BOM errors in the file. You can right-click on each error and select to remove the BOM.
Solution 4:
If you are using Android Studio 3.3.1
Just right-click on the file, from the menu you will find Remove BOM
Solution 5:
You can use some tool to convert your file to UTF-8 with BOM.
I used Notepad++:
- remove "
<?xml version="1.0" encoding="utf-8"?>
" from file if it is. (I used Notepad for that) - open file with Notepad++.
- ensure you see characters as they should be
- select Menu -> Encoding -> Convert to UTF-8
- add "
<?xml version="1.0" encoding="utf-8"?>
" at file start
Post a Comment for "Android Studio Writing Bom's To Utf-8 File"