all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* German umlaut problems after moving from Windows to Linux
@ 2004-02-27 10:30 Thomas Gehrlein
  2004-02-28 16:26 ` LEE Sau Dan
  2004-02-29 11:12 ` Jesper Harder
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Gehrlein @ 2004-02-27 10:30 UTC (permalink / raw)


Hi,

I moved my home directory from a Windows to a Linux box.  Now I'm getting
problems with umlauts in my .diary file.

I set the month name by loading german-holiday.el:

(setq calendar-month-name-array
      ["Januar" "Februar" "März" "April" "Mai" "Juni"
       "Juli" "August" "September" "Oktober" "November" "Dezember"])

C-x= on the "ä" in "März" says:

  character: ä (04344, 2276, 0x8e4)
    charset: latin-iso8859-1 (Right-Hand Part of Latin Alphabet 1 (ISO/IEC 8859-1): ISO-IR-100)
 code point: 100
     syntax: word
   category: l:Latin  
buffer code: 0x81 0xE4
  file code: 0x81 0xE4 (encoded by coding system emacs-mule-dos)
       font: -Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-1

When I do C-u C-x C-e with point after calendar-month-name-array, I get:

["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August" "September"
"Oktober" "November" "Dezember"]

C-x= on the "ä" in "März" says:

  character: ä (07544, 3940, 0xf64)
    charset: latin-iso8859-15 (Right-Hand Part of Latin Alphabet 9 (ISO/IEC 8859-15): ISO-IR-203)
 code point: 100
     syntax: word
   category: l:Latin  
buffer code: 0x8E 0xE4
  file code: 0x8E 0xE4 (encoded by coding system emacs-mule-dos)
       font: -Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-15

1) Which of the 2 "ä" is the "correct" one for a Linux system?
2) How can I turn all "ä"s in .diary in "correct" äs?
3) How can I tell Emacs: "Take all umlauts and other weird characters in my
   home directory and make with them whatever you want - but don't ever bother
   me with this kind of $&%$&$% again"?

TIA

Thomas

PS: The only German month with an umlaut starts next Monday.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: German umlaut problems after moving from Windows to Linux
  2004-02-27 10:30 German umlaut problems after moving from Windows to Linux Thomas Gehrlein
@ 2004-02-28 16:26 ` LEE Sau Dan
  2004-03-01 14:27   ` Thomas Gehrlein
  2004-03-01 16:14   ` Piet van Oostrum
  2004-02-29 11:12 ` Jesper Harder
  1 sibling, 2 replies; 8+ messages in thread
From: LEE Sau Dan @ 2004-02-28 16:26 UTC (permalink / raw)


>>>>> "Thomas" == Thomas Gehrlein <thomas.gehrlein@t-online.de> writes:

    Thomas> 1) Which of the 2 "ä" is the "correct" one for a Linux
    Thomas> system?

Both.  They both  show up alike on my  computer.  The computer (Emacs)
cares about  the difference  between an  ä in iso-8859-1  and an  ä in
iso-8859-15.  I don't.   (You can type in the  former using the intput
methods latin-1-* and the later with latin-9-*.)


    Thomas> 2) How can I turn all "ä"s in .diary in "correct" äs?

(defun iso-8859-15to1 (from to) ; for German only.  Not French, Italian...
  (interactive "r")
  (save-excursion
    (goto-char from)
    (while (re-search-forward "[äÄöÖüÜßëËïÏ]" to t)
      (let ((matched-char (string-to-char (match-string 0))))
	(replace-match
	 (char-to-string
	  (cond ((eq matched-char ?\ä) ?\ä)
		((eq matched-char ?\Ä) ?\Ä)
		((eq matched-char ?\ö) ?\ö)
		((eq matched-char ?\Ö) ?\Ö)
		((eq matched-char ?\ü) ?\ü)
		((eq matched-char ?\Ü) ?\Ü)
		((eq matched-char ?\ß) ?\ß)
		((eq matched-char ?\ë) ?\ë)
		((eq matched-char ?\Ë) ?\Ë)
		((eq matched-char ?\ï) ?\ï)
		((eq matched-char ?\Ï) ?\Ï)
		(t (error "bug %s" matched-char)))))))
    ))



    Thomas> 3) How can I tell Emacs: "Take all umlauts and other weird
    Thomas> characters in my home directory and make with them
    Thomas> whatever you want - but don't ever bother me with this
    Thomas> kind of $&%$&$% again"?

For  me,  the  only  problem  is  with  searching  (regexp  matching).
Otherwise, I don't care.  But I don't use German that often.


-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: German umlaut problems after moving from Windows to Linux
  2004-02-27 10:30 German umlaut problems after moving from Windows to Linux Thomas Gehrlein
  2004-02-28 16:26 ` LEE Sau Dan
@ 2004-02-29 11:12 ` Jesper Harder
  2004-02-29 13:05   ` Thomas Gehrlein
  1 sibling, 1 reply; 8+ messages in thread
From: Jesper Harder @ 2004-02-29 11:12 UTC (permalink / raw)


Thomas Gehrlein <thomas.gehrlein@t-online.de> writes:

> I moved my home directory from a Windows to a Linux box.  Now I'm getting
> problems with umlauts in my .diary file.

You didn't explain what the actual problem is -- just that you get
different encodings for umlauts.  _Why_ is that a problem?

> 1) Which of the 2 "ä" is the "correct" one for a Linux system?

It shouln't matter.

> 2) How can I turn all "ä"s in .diary in "correct" äs?

Put a coding cookie in the file, e.g.

;-*- mode: Emacs-Lisp; coding: latin-1; -*-

if you want Latin-1.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: German umlaut problems after moving from Windows to Linux
  2004-02-29 11:12 ` Jesper Harder
@ 2004-02-29 13:05   ` Thomas Gehrlein
  2004-02-29 13:29     ` Jesper Harder
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Gehrlein @ 2004-02-29 13:05 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> writes:

> Thomas Gehrlein <thomas.gehrlein@t-online.de> writes:
>
>> I moved my home directory from a Windows to a Linux box.  Now I'm getting
>> problems with umlauts in my .diary file.
>
> You didn't explain what the actual problem is -- just that you get
> different encodings for umlauts.  _Why_ is that a problem?

The word "März" in my .diary file is different from the word "März" in
calendar-month-name-array.  As a result, calendar does not understand diary
entries with the word "Mär" (like in "12 Mär 2004") anymore.

I use calendar and diary for all my appointments.  If I don't see my
appointments for March anymore, I will be in trouble ...

Anyway, it was all my fault.

Everything works fine after commenting out the following lines in my .emacs:

(set-language-environment "Latin-1")	;funktioniert wohl für die meisten
					;europäischen sprachen

;; problems with latin-9 on Windows
(define-coding-system-alias 'latin-9 'latin-1)
(define-coding-system-alias 'iso-8859-15 'latin-1)

I don't remember exactly, why I added the last two lines.  I think it had to do
with Gnus.

Thanks for your reply.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: German umlaut problems after moving from Windows to Linux
  2004-02-29 13:05   ` Thomas Gehrlein
@ 2004-02-29 13:29     ` Jesper Harder
  2004-03-01  7:02       ` Thomas Gehrlein
  0 siblings, 1 reply; 8+ messages in thread
From: Jesper Harder @ 2004-02-29 13:29 UTC (permalink / raw)


Thomas Gehrlein <thomas.gehrlein@t-online.de> writes:

> ;; problems with latin-9 on Windows
> (define-coding-system-alias 'latin-9 'latin-1)
> (define-coding-system-alias 'iso-8859-15 'latin-1)
>
> I don't remember exactly, why I added the last two lines.  I think
> it had to do with Gnus.

Previous versions of Emacs didn't support Latin-9, which is probably
why you added them.  Now that Emacs 21.3 does, you'll want to get rid
of the two lines.

By the way, when you do things like that it's always a good idea to
guard it with a test, e.g.

(unless (coding-system-p 'latin-9)
  (define-coding-system-alias 'latin-9 'latin-1))

which makes it more future-proof.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: German umlaut problems after moving from Windows to Linux
  2004-02-29 13:29     ` Jesper Harder
@ 2004-03-01  7:02       ` Thomas Gehrlein
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Gehrlein @ 2004-03-01  7:02 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> writes:

>> ;; problems with latin-9 on Windows
>> (define-coding-system-alias 'latin-9 'latin-1)
>> (define-coding-system-alias 'iso-8859-15 'latin-1)
>>
>> I don't remember exactly, why I added the last two lines.  I think
>> it had to do with Gnus.
>
> Previous versions of Emacs didn't support Latin-9, which is probably
> why you added them.  Now that Emacs 21.3 does, you'll want to get rid
> of the two lines.
>
> By the way, when you do things like that it's always a good idea to
> guard it with a test, e.g.
>
> (unless (coding-system-p 'latin-9)
>   (define-coding-system-alias 'latin-9 'latin-1))
>
> which makes it more future-proof.

Good piece of advice.  I think I'll need to go through my .emacs line by line
and check for other stuff that that is OS or version specific and might cause
trouble.

Thank you for your help.

Thomas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: German umlaut problems after moving from Windows to Linux
  2004-02-28 16:26 ` LEE Sau Dan
@ 2004-03-01 14:27   ` Thomas Gehrlein
  2004-03-01 16:14   ` Piet van Oostrum
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Gehrlein @ 2004-03-01 14:27 UTC (permalink / raw)


LEE Sau Dan <danlee@informatik.uni-freiburg.de> writes:

>>>>>> "Thomas" == Thomas Gehrlein <thomas.gehrlein@t-online.de> writes:

> (defun iso-8859-15to1 (from to) ; for German only.  Not French, Italian...
[...]

Thanks for that function.  I fixed the problem by removing a few lines from my
.emacs (see my other post), but I think I might find some use for it, sooner or
later.

>     Thomas> 3) How can I tell Emacs: "Take all umlauts and other weird
>     Thomas> characters in my home directory and make with them
>     Thomas> whatever you want - but don't ever bother me with this
>     Thomas> kind of $&%$&$% again"?
>
> For  me,  the  only  problem  is  with  searching  (regexp  matching).

I find it confusing when C-s ä finds only some äs and not others.

> Otherwise, I don't care.  But I don't use German that often.

I use it a lot ...  You wouldn't believe how many umlauts I put in my files
;-).

Thanks a lot

Thomas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: German umlaut problems after moving from Windows to Linux
  2004-02-28 16:26 ` LEE Sau Dan
  2004-03-01 14:27   ` Thomas Gehrlein
@ 2004-03-01 16:14   ` Piet van Oostrum
  1 sibling, 0 replies; 8+ messages in thread
From: Piet van Oostrum @ 2004-03-01 16:14 UTC (permalink / raw)


>>>>> LEE Sau Dan <danlee@informatik.uni-freiburg.de> (LSD) wrote:

>>>>> "Thomas" == Thomas Gehrlein <thomas.gehrlein@t-online.de> writes:
Thomas> 1) Which of the 2 "ä" is the "correct" one for a Linux
Thomas> system?

LSD> Both.  They both  show up alike on my  computer.  The computer (Emacs)
LSD> cares about  the difference  between an  ä in iso-8859-1  and an  ä in
LSD> iso-8859-15.  I don't.   (You can type in the  former using the intput
LSD> methods latin-1-* and the later with latin-9-*.)

Then you have to use unicode unification. I don't know in which version it
appeared. I use it all the time but I work with the CVS version.
-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum@hccnet.nl

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-03-01 16:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-27 10:30 German umlaut problems after moving from Windows to Linux Thomas Gehrlein
2004-02-28 16:26 ` LEE Sau Dan
2004-03-01 14:27   ` Thomas Gehrlein
2004-03-01 16:14   ` Piet van Oostrum
2004-02-29 11:12 ` Jesper Harder
2004-02-29 13:05   ` Thomas Gehrlein
2004-02-29 13:29     ` Jesper Harder
2004-03-01  7:02       ` Thomas Gehrlein

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.