[Top][All Lists]

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

Re: eww doesn't decode %AA%BB%CC URL names

From: Eli Zaretskii
Subject: Re: eww doesn't decode %AA%BB%CC URL names
Date: Thu, 24 Dec 2015 23:11:20 +0200

> From: Lars Ingebrigtsen <address@hidden>
> Date: Thu, 24 Dec 2015 22:04:08 +0100
> After spelunking down into `set-language-environment', it seems like
> it's the setting of `default-file-name-coding-system' that's the problem
> here:
> (encode-coding-string
>  (decode-coding-string
>   (url-unhex-string "%D0%A1%D0%B5%D1%80%D0%B4%D1%86%D0%B5")
>   'utf-8)
>  default-file-name-coding-system)
> => "      "
> So I guess the file name should remain those percentages if it can't be
> encoded using that...  but how do I check that, then?  :-)

If you want to check that STRING can be encoded in CODING, do this:

  (member CODING (find-coding-systems-string STRING))

and see if the result is non-nil.

For file names, you should do this test with file-name-coding-system,
if that's non-nil, else with default-file-name-coding-system.

> Charsets are hard!


reply via email to

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