Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] [RESOLVED] Re: What's the easiest way to edit EUC-JP files on a remote server from an



eizietheez@example.com writes:

 > Hrm. Not quite sure I understand the problem. I just created a euc-jp file on
 > my remote server and was able to successfully edit it through ssh:
 > 
 >     $ file foo.txt
 >     foo.txt: ISO-8859 text
 >     $ scp foo.txt example.com:
 >     $ vim --cmd 'set fileencodings=euc-jp' scp://example.com/foo.txt

There's no evidence whatsoever there that you created an euc-jp file.
In fact, given the output from file, it seems likely enough that it's
an ISO-8859-1 file, or even US-ASCII.  You need to do something like
this:

echo 'これは日本語です。" | iconv -f $mydefaultencoding -t euc-jp > foo.txt

where mydefaultencoding is probably UTF-8 if you're using a post-2005
Linux box.  Any other method to demonstrate that you had JIS
characters in the text would do, of course.

 > Really, there shouldn't be any need to make your vterm character
 > encoding pay homage to the character encoding of a particular file.

The method you used edits a local file displaying in a *term on the
local machine then transfers the file to the remote.  Edgar prefers to
use a *term originating on the remote machine to edit on the remote
machine.

In Edgar's approach, whether you need to tell the *term what the
encoding is depends on how your vim is configured on the remote
machine.  If (as seems extremely likely, given that the remote system
is so old that it uses EUC-JP natively) it defaults to simply
splatting bytes from the editing buffer to the screen, then the
terminal needs to know what encoding is coming at it so it knows (1)
how to break up the bytestream into characters, and (2) which index
file to use to look up glyphs in the font files.

Steve



Home | Main Index | Thread Index