jfs
jfs

Reputation: 414695

How to make emacs accept UTF-8 (uppercase) encoding?

The following specifies file's character encoding:

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

But the uppercase variant:

# -*- coding: UTF-8 -*-

produces:

Warning (mule): Invalid coding system `UTF-8' is specified for the current buffer/file by the :coding tag. It is highly recommended to fix it before writing to a file.

Version: GNU Emacs 23.3.1

UTF-8 is an official name for the utf-8 character encoding.

The obvious add-to-coding-system-list function doesn't apply in this case. How to make UTF-8 to be alias for utf-8 in the coding declaration?

Upvotes: 17

Views: 5330

Answers (1)

Alex Ott
Alex Ott

Reputation: 87249

I think, that following code will help you:

(define-coding-system-alias 'UTF-8 'utf-8)

Upvotes: 35

Related Questions