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

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

Re: Encoding multibyte strings


From: Eric Abrahamsen
Subject: Re: Encoding multibyte strings
Date: Fri, 08 Apr 2016 16:02:33 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Date: Fri, 08 Apr 2016 15:40:31 +0800
>> 
>> > Not sure what exactly are you looking for.  A wild guess is that
>> 
>> What I'm looking for, I guess, is this:
>> 
>> (mystery-function "陈”) --> "=E9=99=88"
>> 
>> >   (encode-coding-string 'utf-8 STRING)
>> 
>> (encode-coding-string "陈" 'utf-8) --> "\351\231\210"
>> 
>> So maybe what I need is a way to get from "\351\231\210" to "=E9=99=88"?
>> 
>> > and
>> >
>> >   (quoted-printable-encode-string STRING)
>> 
>> (quoted-printable-encode-string "陈")
>> 
>> Evalling the above gives me the message "Multibyte character in QP
>> encoding region"
>
> I said "and", didn't I?
>
>   (quoted-printable-encode-string (encode-coding-string "陈" 'utf-8))
>    --> "=E9=99=88"

You did! And, as always, technically correct is the best kind of correct
:)

Thanks for this. Eventually I will soak up the appropriate knowledge
regarding string encoding, but it's taking a while.

Thanks again,
Eric




reply via email to

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