help-gnu-emacs
[Top][All Lists]
Advanced

[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 08:58:55 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

On Fri, 15 Aug 2008 20:04:42 +0300 Eli Zaretskii <eliz@gnu.org> wrote: 

>> From: Ted Zlatanov <tzz@lifelogs.com>
>> Date: Fri, 15 Aug 2008 10:54:20 -0500
>> 
>> There should probably be a specific function for this:
>> 
>> (decode-coding-string-as-unibyte "íóëü" 'cp1251)
>> 
>> ditto for decode-coding-region.  Should I add it or is that not
>> generally useful?

EZ> Personally, I think it's not useful, since decode-coding-region and
EZ> decode-coding-string are used only on unibyte text.  But feel free to
EZ> raise this on emacs-devel.

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.

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 :)

On Fri, 15 Aug 2008 20:06:59 +0400 Dmitry Dzhus <dima@sphinx.net.ru> wrote: 

DD> That was nitpicking somewhat irrelevant to unibyte-multibyte problem:
DD> Ted expected to get «нуль», and it's «íóëü», though the string he
DD> originally provided — «íîëü» — decodes to «ноль»; however, both «нуль»
DD> and «ноль» mean «zero».

Yes, I was translating from Russian and knew the text said "zero" but
didn't remember the correct spelling.  Thanks for checking.

Ted


reply via email to

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