all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ken <gebser@mousecar.com>
To: GNU Emacs List <help-gnu-emacs@gnu.org>
Subject: Re: utf8 char display in buffer
Date: Fri, 12 Jun 2009 10:54:23 -0400	[thread overview]
Message-ID: <4A326C1F.1060601@mousecar.com> (raw)
In-Reply-To: <aJKdnVvH4ebY5a3XnZ2dnUVZ_vOdnZ2d@sysmatrix.net>

Ed,

Thanks for distributing.


Everyone responding to this thread,

Please either CC me when posting about this issue or else edit the "To"
field so that your response comes to the whole list.  I'd like to get
everyone's input.  Thanks.


Lewis,

Thanks for posting.  It's lonely out there when you're the only one with
a particular problem.  To make sure we're suffering the same
cyber-indignity, here's the scenario as I see it (from an older version
of emacs running on Linux):

0) Some others and myself want to include some non-English characters in
a file being edited in emacs. Problems arise, however:

1) In a buffer which is already utf-8 encoded, I set the appropriate
input method, type in the desired characters. They display just peachy
and there is happiness in EmacsLand.

2) I save the buffer to a file, then close the buffer.

3) I visit the same file (i.e., load it again into emacs). Because it
has &lt;!-- -*- coding: utf-8; -*- --&gt; as the first line, it opens
utf-8 encoded. This is confirmed by the presence of a 'u' as the second
character in the status bar.

4) The text in the buffer displays fine, except that in place of each of
those non-English characters is a little empty box. With the cursor on
one of those boxes, an 'a' with a horizontal bar above it, doing "C-x
=", emacs returns "Char: ā (01210041, 331809, 0x51021, file ...)".
(While, in emacs the character after "Char:" is a little box, if I load
this same file into Firefox, that same character appears as it should,
as an 'a' with a horizontal bar above it. How it appears in your email
client will depend upon your email client.)

A) The fact that, as described in (4), the characters display correctly
in Firefox, but not in emacs indicates that emacs is not drawing on the
needed character set. Yet, the fact that in (1) the characters initially
display correctly (when first input) indicates that the needed character
set is present on the system and emacs can find it and has permission
access it. Further, we would think that emacs would throw out an error
message if either of these conditions were not met... and it doesn't. We
can only assume that, when visiting and then decoding a file and pulling
into a buffer for display, emacs is not even asking for the proper
character set when encountering a non-English character. This is where I
would start to look for the error.

B) It would be helpful if the code which does the decoding of a file and
renders it into the buffer display, if that part of it would throw an
error message when it encounters a character it doesn't know how to
display, i.e., when a little box character is displayed. After all,
isn't it an error when a little box is displayed in lieu of the correct
character? Possible error messages would be something like: "decoding
process can't find /path/to/charset.file" or "decoding process doesn't
have requisite permission to read /path/to/charset.file" or "invalid
character: [hex/decimal value]" or other.


On 06/10/2009 11:21 PM B. T. Raven wrote:
> Lewis Perin wrote:
>> I've been following this thread closely because I have the original
>> poster's problem, only the characters that give me trouble are some -
>> not many, actually - Chinese characters, e.g. ni3, the normal second
>> person pronoun.  And, as with the original poster, the troublesome
>> characters, when copied and pasted to other applications from Emacs,
>> display perfectly.
>>
>> "B. T. Raven" <nihil@nihilo.net> writes:
>>
>>> [...]
>>>    (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)
>>>          (prefer-coding-system                   'utf-8)
>>>          (modify-coding-system-alist 'process
>>> "[cC][mM][dD][pP][rR][oO][xX][yY]" 'utf-8-dos)
>>>
>>>
>>> and try C-x ret c utf-8
>>> C-x C-f
>>>
>>> to open the file.
>>
>> I tried this, but it didn't help.  Emacs 22.3 / Win32.
> 
> Even on Emacs 23 although I see the characters in the buffer, I can't
> save the following as utf-8:
> 
> nǐ hǎo 你 好
> u+4f60 and u+597d
> 
> Or at least not so as to be readable with 22.3. Both versions are using
> Arial Unicode MS.
> 
> Why is that?
> 
> 
>>
>> /Lew
>> ---
>> Lew Perin / perin@acm.org
>> http://www.panix.com/~perin/babelcarp.html




  reply	other threads:[~2009-06-12 14:54 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.227.1244485995.2239.help-gnu-emacs@gnu.org>
2009-06-08 19:10 ` utf8 char display in buffer Teemu Likonen
2009-06-08 19:52 ` Xah Lee
2009-06-09 10:52   ` ken
2009-06-08 20:43 ` B. T. Raven
2009-06-08 20:49   ` B. T. Raven
2009-06-08 22:49     ` ken
2009-06-09 10:24   ` ken
     [not found]   ` <mailman.289.1244543082.2239.help-gnu-emacs@gnu.org>
2009-06-09 13:03     ` B. T. Raven
2009-06-09 14:51       ` ken
     [not found]       ` <mailman.297.1244559110.2239.help-gnu-emacs@gnu.org>
2009-06-10  1:34         ` B. T. Raven
2009-06-10 14:03           ` Lewis Perin
2009-06-11  3:21             ` B. T. Raven
2009-06-12 14:54               ` ken [this message]
2009-06-13  3:30                 ` Eli Zaretskii
     [not found]               ` <mailman.522.1244818530.2239.help-gnu-emacs@gnu.org>
2009-06-12 15:39                 ` Lewis Perin
2009-06-12 16:48                   ` B. T. Raven
2009-06-12 17:45                     ` Lewis Perin
2009-06-12 17:53                     ` Xah Lee
2009-06-12 20:59                       ` Lennart Borgman
2009-06-12 22:23                       ` ken
2009-06-12 22:27                         ` Lennart Borgman
2009-06-12 23:38                           ` ken
2009-06-13  4:11                             ` Eli Zaretskii
2009-06-13 12:30                               ` ken
2009-06-13 13:23                                 ` Eli Zaretskii
2009-06-14 20:59                             ` Stefan Monnier
2009-06-13  1:36                           ` Miles Bader
2009-06-13  1:43                             ` Lennart Borgman
2009-06-13  5:50                             ` Richard Stallman
2009-06-15  4:34                               ` Miles Bader
2009-06-15 19:30                                 ` Richard Stallman
2009-06-16  0:30                                   ` James Cloos
2009-06-16  1:10                                     ` Miles Bader
2009-06-16  1:12                                       ` Miles Bader
2009-06-17  5:07                                         ` Richard Stallman
2009-06-16 13:53                                     ` Chong Yidong
2009-06-16 20:48                                   ` Stefan Monnier
2009-06-15 20:06                               ` Chong Yidong
2009-06-15 21:57                                 ` Drew Adams
2009-06-16  5:30                                 ` Richard Stallman
     [not found]                       ` <mailman.536.1244845400.2239.help-gnu-emacs@gnu.org>
2009-06-13  0:35                         ` Xah Lee
2009-06-12 17:27                 ` Xah Lee
2009-06-12 19:30                   ` Lewis Perin
2009-06-12 19:43                     ` Xah Lee
2009-06-12 20:56                   ` B. T. Raven
2009-06-13 16:16                     ` Xah Lee
2009-06-13 20:35                   ` Lewis Perin
2009-06-14 11:47                     ` ken
2009-06-15  7:28                       ` Bernardo
2009-06-11 12:03 ` Teemu Likonen
2009-06-11 12:55   ` Lennart Borgman
2009-06-11 13:04     ` Andreas Schwab
2009-06-11 13:07       ` Lennart Borgman
2009-06-11 13:08         ` Lennart Borgman
2009-06-11 13:24           ` Tassilo Horn
2009-06-08 18:33 ken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A326C1F.1060601@mousecar.com \
    --to=gebser@mousecar.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.