unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: joakim@verona.se, emacs-devel@gnu.org
Subject: Re: String handling in xwidget primitives
Date: Sat, 30 Jan 2016 09:57:37 +0200	[thread overview]
Message-ID: <83zivnwlce.fsf@gnu.org> (raw)
In-Reply-To: <56ABEE50.7070804@cs.ucla.edu> (message from Paul Eggert on Fri,  29 Jan 2016 14:57:20 -0800)

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Fri, 29 Jan 2016 14:57:20 -0800
> 
> On 01/29/2016 11:16 AM, Eli Zaretskii wrote:
> > The primitives xwidget-webkit-goto-uri and
> > xwidget-webkit-execute-script accept Lisp strings as arguments and
> > pass their data unaltered to the underlying GTK functions.  I think we
> > need to encode these strings first, but I cannot figure out which
> > encoding should be used.  Is it UTF-8 or something locale-dependent?
> 
> As I understand it the default is UTF-8, but you can override this by 
> using a custom encoding. I'd guess we should just use the default.

Sure, if UTF-8 is accepted by default, it's the best and easiest
alternative.

> Dumb question: shouldn't URIs be encoded in punycode?

Good question.  I don't know.  The URI gets passed to the
webkit_web_view_load_uri API from WebKitGTK, whose documentation says
nothing about this (or the encoding in general).  Maybe someone could
look in the sources and figure out what's TRT, or find the information
somewhere.  My personal impression from googling about this is that at
least JS seems to not expect URIs in punycode.  But I may be mistaken.

> > Also, random documents on the Internet claim JS scripts should have a
> > BOM if they are in UTF-8, is that correct?
> >
> 
> I'm skeptical. No doubt there are issues in this area, but I can also 
> find random documents saying that JS scripts *with* BOMs make programs 
> croak, e.g.:
> 
> http://compgroups.net/comp.lang.php/javascript-php-byte-order-mark-problem/1384837
> 
> Plus, I see some evidence that at least one JavaScript linter will warn 
> you about BOMs:
> 
> https://github.com/jshint/jshint/pull/2285

Thanks, I guess that answers the question.



  reply	other threads:[~2016-01-30  7:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 19:16 String handling in xwidget primitives Eli Zaretskii
2016-01-29 22:57 ` Paul Eggert
2016-01-30  7:57   ` Eli Zaretskii [this message]
     [not found] <83bn84xn2p.fsf@gnu.org>
     [not found] ` <m3lh78rxwe.fsf@exodia.verona.se>
2016-01-29 20:25   ` Eli Zaretskii

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=83zivnwlce.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    /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).