unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Thanos Apollo <public@thanosapollo.com>
Cc: emacs-devel@gnu.org
Subject: Re: Unicode characters display issue
Date: Sun, 02 Jul 2023 15:25:07 +0300	[thread overview]
Message-ID: <83fs66o5zw.fsf@gnu.org> (raw)
In-Reply-To: <878rbyldzy.fsf@zeus> (message from Thanos Apollo on Sun, 02 Jul 2023 14:53:59 +0300)

> From: Thanos Apollo <public@thanosapollo.com>
> Cc: emacs-devel@gnu.org
> Date: Sun, 02 Jul 2023 14:53:59 +0300
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > It's hard to answer your questions without knowing what you did,
> > exactly.  Can you come up with a simplified Lisp program that behaves
> > like you describe, so that we could study it and see what you are
> > doing wrong?
> 
> Thanks for the reply!
> 
> ``` 
> (switch-to-buffer (url-retrieve-synchronously
> "https://www.youtube.com/results?search_query=greece+survivor" t t))
> ```
> 
> After evaluating the above code and searching forward for "videoid"
> you will be presented with unicode character sequences.

This is a unibyte buffer: "M-: enable-multibyte-characters RET"
reports nil.  So what you see are raw bytes of the encoded text.  You
need to decode it, e.g., by using decode-coding-region.  The header
says "Content-Type: text/html; charset=utf-8", so the coding-system to
use in decoding is utf-8.  For example:

  (decode-coding-region (point-min) (point-max) 'utf-8
                        (get-buffer-create "decoded"))



      reply	other threads:[~2023-07-02 12:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-02 10:22 Unicode characters display issue Thanos Apollo
2023-07-02 11:51 ` Eli Zaretskii
2023-07-02 11:53   ` Thanos Apollo
2023-07-02 12:25     ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83fs66o5zw.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=public@thanosapollo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).