I modified a UTF-8
encoded xml file using vi editor and saved it.
I'm on Redhat Linux 7.9
I checked the file encoding after the changes and found it to be us-ascii
file --mime-encoding tmpfiles/08/config/jdbc/jdbc.xml
tmpfiles/08/config/jdbc/jdbc.xml: us-ascii
I decided to change the encoding back to UTF-8
using the below command:
iconv -f us-ascii -t UTF-8 tmpfiles/08/config/jdbc/jdbc.xml >tmpfiles/08/config/jdbc/jdbc.xmlenc
echo $?
0
However, the encoding for the new file jdbc.xmlenc
did not change to UTF-8
and remained unchanged. See the output below:
file --mime-encoding tmpfiles/08/config/jdbc/jdbc.xmlenc
tmpfiles/08/config/jdbc/jdbc.xmlenc: us-ascii
Can you please suggest how can i change the file encoding to UTF-8
?