* I need to use UTF8... sometimes
@ 2010-10-06 11:35 Gary
2010-10-06 11:55 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Gary @ 2010-10-06 11:35 UTC (permalink / raw)
To: help-gnu-emacs
Okay, here is the situation. My local environment uses ISO-8559-1
("latin-1") -
,----
| $ env | grep -iE "(LANG|LC_)"
| LC_MESSAGES=en_US.ISO-8859-1
| LANG=de_CH.ISO-8859-1
| LC_TIME=en_GB.ISO-8859-1
`----
I now need to be able to transfer files *inside emacs* to a remote
server. I intended to use the following simple function to do that:
,----
| (defun foo-upload-buffer ()
| "Uploads the current (foo) buffer."
| (interactive)
|
| (eshell-command
| (concat foo-scp buffer-file-name " "
| foo-server-user "@" foo-server ":" foo-server-path))
| )
`----
and then found out that the server ("foo-server", above) expects the
files to be in UTF-8 :(
I don't really want to change my use of ISO-8559-1 for various reasons,
not least of all being that I deal with lots of other systems that
expect files in that encoding. Nor do I really want to use UTF-8 locally
for these particular files, because it means I can't grep them
properly.
So what I am wondering is what the easiest way is to do the transfer
using UTF-8 but still edit locally in ISO-8559-1. I wondered if
foo-upload-buffer should write the buffer to a temporary file, convert
it to UTF-8, and then transfer that, but it seems a bit longwinded. Any
other ideas?
--
Gary Please do NOT send me 'courtesy' replies off-list.
GNU Emacs 23.2.1
emacsclient 23.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: I need to use UTF8... sometimes
2010-10-06 11:35 I need to use UTF8... sometimes Gary
@ 2010-10-06 11:55 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2010-10-06 11:55 UTC (permalink / raw)
To: help-gnu-emacs
> From: Gary <help-gnu-emacs@garydjones.name>
> Date: Wed, 06 Oct 2010 13:35:22 +0200
> Mail-Copies-To: never
>
> So what I am wondering is what the easiest way is to do the transfer
> using UTF-8 but still edit locally in ISO-8559-1. I wondered if
> foo-upload-buffer should write the buffer to a temporary file, convert
> it to UTF-8, and then transfer that, but it seems a bit longwinded. Any
> other ideas?
Bind coding-system-for-write to 'utf-8 before invoking the Eshell
command. That should do the trick.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-06 11:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-06 11:35 I need to use UTF8... sometimes Gary
2010-10-06 11:55 ` Eli Zaretskii
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.