Subject: Re: bug#6974: Emacs doesn't like Swedish ä (on w32)

From: Andreas Röhler <[email-masked]>
Date: Fri, 03 Sep 2010 18:23:33 +0200

Am 03.09.2010 15:49, schrieb Eli Zaretskii:
>> Date: Fri, 03 Sep 2010 11:46:00 +0200
>> From: Andreas Röhler<[email-masked]>
>> CC: [email-masked]
>>
>>> The most probable reason for Emacs not to decode the file correctly
>>> (as UTF-8) is that the file includes some bytes that are invalid UTF-8
>>> sequences.  What happens if you force UTF-8 with "C-x RET c" before
>>> visiting the file with "C-x C-f"?
>>>
>>
>> All fine at the first glance than.
>>
>> However, re-opening the newly saved buffer repeats the wrong display.
>
> Sure, because the problem that caused Emacs to decode the file as
> raw-text is still in the file.
>
>> Also when saving, it always prompts for coding-system, suggests raw-text
>> first.
>
> Expected, since there are problematic characters in the file.  Try
> this:
>
>   M-: (unencodable-char-position (point-min) (point-max) 'utf-8) RET
>
> It should show you the first position in the buffer where you have a
> character that cannot be encoded by UTF-8.  If all the characters can
> be encoded by UTF-8, this will evaluate to nil.

With buffer narrowed to the code from screen-shot it says:

3993 (#o7631, #xf99)

>
>> Setting buffer-file-coding-system explicitly to utf-8-unix, followed by
>> a save, doesn't change the wrong display after new opening.
>
> And it shouldn't.
>