Menu

Automatically detecting source file encoding

Erick
2011-08-15
2013-03-15
  • Erick

    Erick - 2011-08-15

    Eclipse is not correctly detecting some of my files' encoding. I found this ticket in the tracker, which supposedly addressed the problem: https://sourceforge.net/tracker/index.php?func=detail&aid=1580757&group_id=85796&atid=577329, but it happens with me all the same.

    I tried writing at the first line of a UTF-8 file both

    # -*- coding: utf-8 -*-
    

    and

    # coding=utf-8
    

    but it didn't help; it seems Eclipse opened it with the default system encoding. Am I missing something?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-08-15

    I just checked it here and it seems to be working for me… (note that it'll only make the change after you save your file).

    How are you checking if the encoding is not OK? (after saving the file, you should be able to go to edit > set encoding and see if the current encoding matches the one you entered - in this case utf-8).

    If it still doesn't work, please check if you have something in your error log.

    Cheers,

    Fabio

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.