all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Specify file encoding when storing a plain text or a source code
@ 2011-01-31 23:33 kovvalsky
  2011-02-01  4:37 ` Deniz Dogan
  2011-02-01  5:56 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: kovvalsky @ 2011-01-31 23:33 UTC (permalink / raw)
  To: Help-gnu-emacs


How do you specify file encoding when storing a plain text or a source code
in emacs?
-
thank you in advance.
-- 
View this message in context: http://old.nabble.com/Specify-file-encoding-when-storing-a-plain-text-or-a-source-code-tp30811936p30811936.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Specify file encoding when storing a plain text or a source code
  2011-01-31 23:33 Specify file encoding when storing a plain text or a source code kovvalsky
@ 2011-02-01  4:37 ` Deniz Dogan
  2011-02-01 10:09   ` kovvalsky
  2011-02-01  5:56 ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Deniz Dogan @ 2011-02-01  4:37 UTC (permalink / raw)
  To: kovvalsky; +Cc: Help-gnu-emacs

2011/2/1 kovvalsky <fibo.kowalsky@gmail.com>:
>
> How do you specify file encoding when storing a plain text or a source code
> in emacs?
> -
> thank you in advance.
> --
> View this message in context: http://old.nabble.com/Specify-file-encoding-when-storing-a-plain-text-or-a-source-code-tp30811936p30811936.html
> Sent from the Emacs - Help mailing list archive at Nabble.com.
>

You can use "C-x RET f" (set-buffer-file-coding-system).

If CODING-SYSTEM leaves the text conversion unspecified, or if it leaves
the end-of-line conversion unspecified, FORCE controls what to do.
If FORCE is nil, get the unspecified aspect (or aspects) from the buffer's
previous `buffer-file-coding-system' value (if it is specified there).
Otherwise, leave it unspecified.

This marks the buffer modified so that the succeeding C-t C-s
surely saves the buffer with CODING-SYSTEM.  From a program, if you
don't want to mark the buffer modified, specify t for NOMODIFY.
If you know exactly what coding system you want to use,
just set the variable `buffer-file-coding-system' directly.

-- 
Deniz Dogan



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

* Re: Specify file encoding when storing a plain text or a source code
  2011-01-31 23:33 Specify file encoding when storing a plain text or a source code kovvalsky
  2011-02-01  4:37 ` Deniz Dogan
@ 2011-02-01  5:56 ` Eli Zaretskii
  2011-02-01 10:12   ` kovvalsky
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2011-02-01  5:56 UTC (permalink / raw)
  To: Help-gnu-emacs

> Date: Mon, 31 Jan 2011 15:33:36 -0800 (PST)
> From: kovvalsky <fibo.kowalsky@gmail.com>
> Cc: 
> 
> 
> How do you specify file encoding when storing a plain text or a source code
> in emacs?

C-x RET c <whatever-encoding-you-like> RET C-x C-s



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

* Re: Specify file encoding when storing a plain text or a source code
  2011-02-01  4:37 ` Deniz Dogan
@ 2011-02-01 10:09   ` kovvalsky
  0 siblings, 0 replies; 7+ messages in thread
From: kovvalsky @ 2011-02-01 10:09 UTC (permalink / raw)
  To: Help-gnu-emacs


I am completely beginner in emacs and we have this question to answer (it's
odd yes) and i am not sure if I understand you answer, but thanks.
I think the answer to my question is:
C-x h                                              #select all text
C-x RET c <encoding> RET            #set encoding for next command
M-x sort-lines                                  #sort the text using the
specified encoding



Deniz Dogan-3 wrote:
> 
> You can use "C-x RET f" (set-buffer-file-coding-system).
> 
> If CODING-SYSTEM leaves the text conversion unspecified, or if it leaves
> the end-of-line conversion unspecified, FORCE controls what to do.
> If FORCE is nil, get the unspecified aspect (or aspects) from the buffer's
> previous `buffer-file-coding-system' value (if it is specified there).
> Otherwise, leave it unspecified.
> 
> This marks the buffer modified so that the succeeding C-t C-s
> surely saves the buffer with CODING-SYSTEM.  From a program, if you
> don't want to mark the buffer modified, specify t for NOMODIFY.
> If you know exactly what coding system you want to use,
> just set the variable `buffer-file-coding-system' directly.
> 
> -- 
> Deniz Dogan
> 

-- 
View this message in context: http://old.nabble.com/Specify-file-encoding-when-storing-a-plain-text-or-a-source-code-tp30811936p30814900.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Specify file encoding when storing a plain text or a source code
  2011-02-01  5:56 ` Eli Zaretskii
@ 2011-02-01 10:12   ` kovvalsky
  2011-02-01 11:26     ` Peter Dyballa
  2011-02-01 13:00     ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: kovvalsky @ 2011-02-01 10:12 UTC (permalink / raw)
  To: Help-gnu-emacs


Thank you very much. I guess this saves file, but I wanted for sorting so
Is it correct for sorting?
C-x h                                              #select all text
C-x RET c <encoding> RET            #set encoding for next command
M-x sort-lines                                  #sort the text using the
specified encoding
and do you know 2 encodings which sort the same text different way?
Just to test my commands.
Thank you.


Eli Zaretskii wrote:
> 
>> Date: Mon, 31 Jan 2011 15:33:36 -0800 (PST)
> C-x RET c <whatever-encoding-you-like> RET C-x C-s
> 

-- 
View this message in context: http://old.nabble.com/Specify-file-encoding-when-storing-a-plain-text-or-a-source-code-tp30811936p30814914.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Specify file encoding when storing a plain text or a source code
  2011-02-01 10:12   ` kovvalsky
@ 2011-02-01 11:26     ` Peter Dyballa
  2011-02-01 13:00     ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2011-02-01 11:26 UTC (permalink / raw)
  To: kovvalsky; +Cc: Help-gnu-emacs


Am 01.02.2011 um 11:12 schrieb kovvalsky:

> and do you know 2 encodings which sort the same text different way?


ISO encodings vs. DOS code pages. But not in the first 7 bit US-ASCII.  
For this use some ISO encoding vs. EBCDIC.

--
Greetings

   Pete

For some reason, this fortune reminds everyone of Marvin Zelkowitz.




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

* Re: Specify file encoding when storing a plain text or a source code
  2011-02-01 10:12   ` kovvalsky
  2011-02-01 11:26     ` Peter Dyballa
@ 2011-02-01 13:00     ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2011-02-01 13:00 UTC (permalink / raw)
  To: Help-gnu-emacs

> Date: Tue, 1 Feb 2011 02:12:00 -0800 (PST)
> From: kovvalsky <fibo.kowalsky@gmail.com>
> Cc: 
> 
> Thank you very much. I guess this saves file, but I wanted for sorting so
> Is it correct for sorting?

No, I don't think so.  Encoding only matters for importing text into
Emacs or exporting it to the outer world (disk files, other processes,
etc.).  Once text is inside an Emacs buffer, it uses the same encoding,
which is the internal Emacs representation of characters (an extension
of UTF-8).



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

end of thread, other threads:[~2011-02-01 13:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 23:33 Specify file encoding when storing a plain text or a source code kovvalsky
2011-02-01  4:37 ` Deniz Dogan
2011-02-01 10:09   ` kovvalsky
2011-02-01  5:56 ` Eli Zaretskii
2011-02-01 10:12   ` kovvalsky
2011-02-01 11:26     ` Peter Dyballa
2011-02-01 13:00     ` 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.