help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Special Characters


From: Yuri Khan
Subject: Re: Special Characters
Date: Tue, 11 Aug 2015 23:21:43 +0600

On Tue, Aug 11, 2015 at 7:37 AM, Ian Baylis <ibay0918@gmail.com> wrote:
> I have a file that has special characters in it.   When I open the file in 
> Emacs an ' is represented like:
> \200\231 or just \231

The Unicode apostrophe ’ (U+2019 Right single quotation mark) is
encoded in UTF-8 as a sequence of three bytes, whose octal
representation is \342\200\231 (or hexadecimal E2 80 99).

If your Emacs incorrectly picks e.g. the ISO-8859-1 (aka Latin-1)
encoding for this file, you will see the letter â (U+00E2 Latin small
letter a with circumflex), followed by two codes \200 and \231,
because those do not correspond to printable characters in Latin-1.

In order to view the file as intended, you need to re-open that file
using the correct encoding (UTF-8). Eli has given you the command:

C-x RET c utf-8 RET C-x C-f FILE-NAME RET

Alternatively, if you already have a buffer visiting the file, you can
revert it using the correct encoding:

C-x RET r utf-8 RET (you might need to confirm the revert).

You then need to evaluate how often you use files in encodings other
than UTF-8. If rarely, you might want to set UTF-8 as your default
encoding.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]