[Top][All Lists]

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

Re: decode-coding-string question

From: Ted Zlatanov
Subject: Re: decode-coding-string question
Date: Mon, 18 Aug 2008 15:07:17 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

On Mon, 18 Aug 2008 22:11:37 +0300 Eli Zaretskii <address@hidden> wrote: 

>> From: Ted Zlatanov <address@hidden>
>> Date: Mon, 18 Aug 2008 08:58:55 -0500
>> How would you recommend decoding text from particular encodings?  Given
>> text like the one shown above in a buffer, only decode-coding-region
>> seems to DTRT, and it's not interactive.

EZ> If you mean interactively, i.e. you visited a buffer and then
EZ> discovered that it was decoded incorrectly, and the actual encoding is
EZ> different, then "C-x RET c cp1251 RET M-x revert-buffer RET" should do
EZ> what you want, I think.

>> Context: I have a file full of CP1251 data and don't want to use Perl's
>> Encode module because I'm stubborn and think Emacs should handle it :)

EZ> What about the rest of the file? is it encoded in some other encoding?
EZ> If not, then the above recipe should do.  If it doesn't, please tell
EZ> more details.

I often have to open mangled files with mixed-up encodings; it's
convenient to set the coding-system after I look at the text, and only
apply it to a region.

On Mon, 18 Aug 2008 18:45:29 +0100 David Golden <address@hidden> wrote: 
[similar advice]

I see it's an uncommon operation, so I'll use the make-unibyte-string
recipe Eli and others recommended.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]