[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: ISO8859<->UTF8 med Emacs



sslug@sslug (Adam Sjøgren) skriver:

> On Sat, 14 Jan 2006 21:57:13 +0100 (CET), Peter wrote:
>
>> Jeg har jævnligt opgaven med at konvertere en fil mellem 
>> ISO8859 til og fra UTF8. Kan man ikke nemt lave det i Emacs?
>
> Er det snyd at kalde recode(1)?
>
> (defun asjo-recode (prefix)
>   "Recode iso-8859-1 to utf-8 by calling /usr/bin/recode.
>    Reverses convertion order if prefix is given."
>   (interactive "p")
>   (let ((convertion (if (> prefix 1) "utf8..iso8859-1" "iso8859-1..utf8")))
>         (shell-command-on-region (point-min) (point-max)
>                                  (concat "/usr/bin/recode " convertion) nil t)))

Så kan man vel ligesågodt kalde recode uden at gå ind i Emacs først.

I Emacs gør `C-x RET f utf-8 RET' at bufferen gemmes i UTF-8 næste
gang bufferen gemmes (og tilsvarende med `C-x RET f iso-8859-1 RET').

Har man læst en fil ind i en Emacs-buffer og har Emacs fortolket
tegnsættet forkert kan man i Emacs 22 (når den engang udkommer) taste
fx `C-x RET r utf-8 RET' og dermed få filen læst ind som værende i
tegnsættet UTF-8.

mvh
        /arne
-- 
Arne Jørgensen <http://arnested.dk/>


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-02-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *