unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Chinese in tramp become ????s
@ 2009-07-29 11:42 Wang Lei
  2009-07-30  4:38 ` Michael Albinus
  0 siblings, 1 reply; 10+ messages in thread
From: Wang Lei @ 2009-07-29 11:42 UTC (permalink / raw)
  To: help-gnu-emacs

Hi, all.

This is an old problem to me. Chinese become '????'s in tramp. Is
there something i can do for this?

Thanks in advance!

-- 
Regards
Lei




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

* Re: Chinese in tramp become ????s
  2009-07-29 11:42 Chinese in tramp become ????s Wang Lei
@ 2009-07-30  4:38 ` Michael Albinus
  2009-07-30  4:57   ` Wang Lei
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2009-07-30  4:38 UTC (permalink / raw)
  To: Wang Lei; +Cc: help-gnu-emacs

Wang Lei <wanglei.198112@gmail.com> writes:

> Hi, all.

Hi,

> This is an old problem to me. Chinese become '????'s in tramp. Is
> there something i can do for this?

Have you tried to set the buffer encoding to Chinese once you have
opened the file? Something like "C-x <RET> r chinese-iso-8bit <RET>" (or
whatever coding system you prefer)

> Thanks in advance!

Best regards, Michael.




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

* Re: Chinese in tramp become ????s
  2009-07-30  4:38 ` Michael Albinus
@ 2009-07-30  4:57   ` Wang Lei
  2009-07-30  5:00     ` Michael Albinus
  0 siblings, 1 reply; 10+ messages in thread
From: Wang Lei @ 2009-07-30  4:57 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

I'v tried it, doesn't work.
Any other advices?

On 7/30/09, Michael Albinus <michael.albinus@gmx.de> wrote:
> Wang Lei <wanglei.198112@gmail.com> writes:
>
>> Hi, all.
>
> Hi,
>
>> This is an old problem to me. Chinese become '????'s in tramp. Is
>> there something i can do for this?
>
> Have you tried to set the buffer encoding to Chinese once you have
> opened the file? Something like "C-x <RET> r chinese-iso-8bit <RET>" (or
> whatever coding system you prefer)
>
>> Thanks in advance!
>
> Best regards, Michael.
>


-- 
Regards
Lei




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

* Re: Chinese in tramp become ????s
  2009-07-30  4:57   ` Wang Lei
@ 2009-07-30  5:00     ` Michael Albinus
  2009-07-31 11:46       ` Wang Lei
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2009-07-30  5:00 UTC (permalink / raw)
  To: Wang Lei; +Cc: help-gnu-emacs

Wang Lei <wanglei.198112@gmail.com> writes:

> I'v tried it, doesn't work.
> Any other advices?

Hmm, hard for me, I don't use Chinese at all.

Which Emacs/Tramp versions are you using? And do you have an example
file I could use for testing? Please tell me also, which coding system I
shall use.

Best regards, Michael.




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

* Re: Chinese in tramp become ????s
  2009-07-30  5:00     ` Michael Albinus
@ 2009-07-31 11:46       ` Wang Lei
  2009-07-31 14:07         ` Michael Albinus
  0 siblings, 1 reply; 10+ messages in thread
From: Wang Lei @ 2009-07-31 11:46 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

Thanks for your help and patient, first.

(tramp-version nil)
"2.1.17-pre"

(emacs-version)
"GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.4)
 of 2009-07-05 on debian"

[~] locale
LANG=en_US.UTF-8
LC_CTYPE=zh_CN.utf8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

configuration in .emacs
---------------------------------
;; tramp
(require 'tramp)
(setq password-cache nil
      tramp-default-method "su"
      tramp-default-user "root"
      tramp-default-host "debian")
(add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil))
---------------------------------
In tramp mode, when I create a direcotry named 你好, it displays
'??????', this is the describe-char's output:
--------------------------------------
        character: ? (63, #o77, #x3f)
preferred charset: ascii (ASCII (ISO646 IRV))
       code point: 0x3F
           syntax: . 	which means: punctuation
         category: .:Base, a:ASCII, l:Latin, r:Roman
      buffer code: #x3F
        file code: #x3F (encoded by coding system utf-8)
          display: by this font (glyph code)
    xft:-bitstream-Courier 10
Pitch-bold-normal-normal-*-17-*-*-*-m-0-iso10646-1 (#x20)

Character code properties: customize what to show
  name: QUESTION MARK
  general-category: Po (Punctuation, Other)

There are text properties here:
  dired-filename       t
  face                 dired-directory
  fontified            t
  help-echo            "mouse-2: visit this file in other window"
  mouse-face           highlight

[back]
-------------------------------------


On 7/30/09, Michael Albinus <michael.albinus@gmx.de> wrote:
> Wang Lei <wanglei.198112@gmail.com> writes:
>
>> I'v tried it, doesn't work.
>> Any other advices?
>
> Hmm, hard for me, I don't use Chinese at all.
>
> Which Emacs/Tramp versions are you using? And do you have an example
> file I could use for testing? Please tell me also, which coding system I
> shall use.
>
> Best regards, Michael.
>


-- 
Regards
Lei




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

* Re: Chinese in tramp become ????s
       [not found] <mailman.3380.1248867788.2239.help-gnu-emacs@gnu.org>
@ 2009-07-31 13:33 ` Colin S. Miller
  0 siblings, 0 replies; 10+ messages in thread
From: Colin S. Miller @ 2009-07-31 13:33 UTC (permalink / raw)
  To: help-gnu-emacs

Wang Lei wrote:
> Hi, all.
> 
> This is an old problem to me. Chinese become '????'s in tramp. Is
> there something i can do for this?
> 
> Thanks in advance!
> 

Are you using ftp, and if so, is it in binary mode?

I assume you can open the file correctly if you copy
it to your local machine.


HTH,
Colin S. Miller


-- 
Replace the obvious in my email address with the first three letters of the hostname to reply.


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

* Re: Chinese in tramp become ????s
  2009-07-31 11:46       ` Wang Lei
@ 2009-07-31 14:07         ` Michael Albinus
  2009-08-01  1:50           ` Wang Lei
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2009-07-31 14:07 UTC (permalink / raw)
  To: Wang Lei; +Cc: help-gnu-emacs@gnu.org

Wang Lei <wanglei.198112@gmail.com> writes:

> Thanks for your help and patient, first.

What happens on the remote host, when you apply

/bin/ls -al /path/

(assuming, that you have created /path/你好 )

> [~] locale
> LANG=en_US.UTF-8
> LC_CTYPE=zh_CN.utf8
> LC_NUMERIC="en_US.UTF-8"
> LC_TIME="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY="en_US.UTF-8"
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER="en_US.UTF-8"
> LC_NAME="en_US.UTF-8"
> LC_ADDRESS="en_US.UTF-8"
> LC_TELEPHONE="en_US.UTF-8"
> LC_MEASUREMENT="en_US.UTF-8"
> LC_IDENTIFICATION="en_US.UTF-8"
> LC_ALL=

Is this on the local or the remote host?

> In tramp mode, when I create a direcotry named 你好, it displays
> '??????', this is the describe-char's output:

Same here. However, if I open /ssh:host:/path/你好/ I can continue to
work. So it seems to be a problem of /bin/ls

Best regards, Michael.




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

* Re: Chinese in tramp become ????s
  2009-07-31 14:07         ` Michael Albinus
@ 2009-08-01  1:50           ` Wang Lei
  2009-08-03  4:04             ` Michael Albinus
  0 siblings, 1 reply; 10+ messages in thread
From: Wang Lei @ 2009-08-01  1:50 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs@gnu.org

On 7/31/09, Michael Albinus <michael.albinus@gmx.de> wrote:
> Wang Lei <wanglei.198112@gmail.com> writes:
>
>> Thanks for your help and patient, first.
>
> What happens on the remote host, when you apply
>
> /bin/ls -al /path/
>
> (assuming, that you have created /path/你好 )

[~/tmp] /bin/ls -al
total 48
drwxr-xr-x  5 lei lei  4096 2009-08-01 09:49 .
drwxr-xr-x 27 lei lei  8192 2009-08-01 09:43 ..
drwxr-xr-x 14 lei lei  4096 2009-07-30 18:12 coreutils-7.4
-rw-r--r--  1 lei lei 18889 2009-06-05 08:47 coreutils_7.4-2.diff.gz
-rw-r--r--  1 lei lei  1247 2009-06-05 08:47 coreutils_7.4-2.dsc
drwxr-xr-x 11 lei lei  4096 2009-02-10 12:36 grep-2.5.4
drwxr-xr-x  2 lei lei  4096 2009-08-01 09:49 你好

>
>> [~] locale
>> LANG=en_US.UTF-8
>> LC_CTYPE=zh_CN.utf8
>> LC_NUMERIC="en_US.UTF-8"
>> LC_TIME="en_US.UTF-8"
>> LC_COLLATE="en_US.UTF-8"
>> LC_MONETARY="en_US.UTF-8"
>> LC_MESSAGES="en_US.UTF-8"
>> LC_PAPER="en_US.UTF-8"
>> LC_NAME="en_US.UTF-8"
>> LC_ADDRESS="en_US.UTF-8"
>> LC_TELEPHONE="en_US.UTF-8"
>> LC_MEASUREMENT="en_US.UTF-8"
>> LC_IDENTIFICATION="en_US.UTF-8"
>> LC_ALL=
>
> Is this on the local or the remote host?
>
I don't use tramp from remote, just as a convenience for su.
(require 'tramp)
(setq password-cache nil
      tramp-default-method "su"
      tramp-default-user "root"
      tramp-default-host "debian")
(add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil))

>> In tramp mode, when I create a direcotry named 你好, it displays
>> '??????', this is the describe-char's output:
>
> Same here. However, if I open /ssh:host:/path/你好/ I can continue to
> work. So it seems to be a problem of /bin/ls
>
> Best regards, Michael.
>
Then. Maybe it's a su's problem?

-- 
Regards
Lei




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

* Re: Chinese in tramp become ????s
  2009-08-01  1:50           ` Wang Lei
@ 2009-08-03  4:04             ` Michael Albinus
  2009-08-03 13:31               ` Wang Lei
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2009-08-03  4:04 UTC (permalink / raw)
  To: Wang Lei; +Cc: help-gnu-emacs@gnu.org

Wang Lei <wanglei.198112@gmail.com> writes:

>>> In tramp mode, when I create a direcotry named 你好, it displays
>>> '??????', this is the describe-char's output:
>>
>> Same here. However, if I open /ssh:host:/path/你好/ I can continue to
>> work. So it seems to be a problem of /bin/ls
>>
> Then. Maybe it's a su's problem?

It's an environment problem. Tramp sets LC_ALL to "C". You should do the
following, before connecting via "su":

(add-to-list 'tramp-remote-process-environment "LANG=zh_CN.utf8" 'append)
(add-to-list 'tramp-remote-process-environment "LC_ALL=zh_CN.utf8" 'append)

Best regards, Michael.




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

* Re: Chinese in tramp become ????s
  2009-08-03  4:04             ` Michael Albinus
@ 2009-08-03 13:31               ` Wang Lei
  0 siblings, 0 replies; 10+ messages in thread
From: Wang Lei @ 2009-08-03 13:31 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs@gnu.org

Yes! It works.
This problem is my headache for a long time. Finally, it's solved.

Thanks, Michael! Thanks you all!

On 8/3/09, Michael Albinus <michael.albinus@gmx.de> wrote:
> Wang Lei <wanglei.198112@gmail.com> writes:
>
>>>> In tramp mode, when I create a direcotry named 你好, it displays
>>>> '??????', this is the describe-char's output:
>>>
>>> Same here. However, if I open /ssh:host:/path/你好/ I can continue to
>>> work. So it seems to be a problem of /bin/ls
>>>
>> Then. Maybe it's a su's problem?
>
> It's an environment problem. Tramp sets LC_ALL to "C". You should do the
> following, before connecting via "su":
>
> (add-to-list 'tramp-remote-process-environment "LANG=zh_CN.utf8" 'append)
> (add-to-list 'tramp-remote-process-environment "LC_ALL=zh_CN.utf8" 'append)
>
> Best regards, Michael.
>


-- 
Regards
Lei




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

end of thread, other threads:[~2009-08-03 13:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29 11:42 Chinese in tramp become ????s Wang Lei
2009-07-30  4:38 ` Michael Albinus
2009-07-30  4:57   ` Wang Lei
2009-07-30  5:00     ` Michael Albinus
2009-07-31 11:46       ` Wang Lei
2009-07-31 14:07         ` Michael Albinus
2009-08-01  1:50           ` Wang Lei
2009-08-03  4:04             ` Michael Albinus
2009-08-03 13:31               ` Wang Lei
     [not found] <mailman.3380.1248867788.2239.help-gnu-emacs@gnu.org>
2009-07-31 13:33 ` Colin S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).