If you select “Refer to encoding declaration” in the Format preferences pane, in-document encoding declarations such as “charset=” or “encoding=” or “@charset” will take precedence when CotEditor auto-detects the character encoding.
=> Using encoding declarations (charset=, encoding=, @charset) for auto-detection