[Top][All Lists]

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

Re: how to work with utf-8

From: Peter Dyballa
Subject: Re: how to work with utf-8
Date: Mon, 18 Apr 2005 01:00:29 +0200

Am 18.04.2005 um 00:16 schrieb Paul Tremblay:

1. Is there an easier way to open a utf-8 file than with:

C-x C-m c utf-8 C-x C-f ?

For example, what if I want to create a new utf-8 file from scratch?

You can set these things in .emacs:

        (set-language-environment               'UTF-8)
        (set-default-coding-systems             'utf-8)
        (setq file-name-coding-system           'utf-8)
        (setq default-buffer-file-coding-system 'utf-8)
        (setq coding-system-for-write           'utf-8)
        (set-keyboard-coding-system             'utf-8)
        (set-terminal-coding-system             'utf-8)
;       (set-clipboard-coding-system            'utf-8)
;       (set-selection-coding-system            'utf-8)
        (set-language-environment               'German)
        (prefer-coding-system                   'iso-8859-15)
        (modify-coding-system-alist 'process "\\*shell\\*\\'" 'utf-8-unix)

and/or set locales like LC_ALL, LC_CTYPE, LANG to contain UTF-8 as for example: LANG=de_DE.UTF-8. Modern Emacsen, I think 21.3 at least, derive their mode of operation from this.

You can start your text files à la: ;;; -*- mode: Text; coding: utf-8; -*- Once you've done that you can C-x RET r: revert-buffer-with-coding-system.

And what you might need most are fontsets of fonts that allow you to see these glyphs.

2. How do I enter utf-8 characters directly in emacs? In vim, there is
a serier of sequences to do this: control k, and then u to indicate a
hexidecimal that has a width of 4, and then something like 201c for a
right curly quote.

Happily I can input these with my keyboard, either directly or with simultaneously pressing the alt key. But for the future I'd like to know a more general method too ...



  Basic, n.:
        A programming language.  Related to certain social diseases in
that those who have it will not admit it in polite company.

reply via email to

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