[Top][All Lists]

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

Re: String handling in xwidget primitives

From: Eli Zaretskii
Subject: Re: String handling in xwidget primitives
Date: Sat, 30 Jan 2016 09:57:37 +0200

> Cc: address@hidden
> From: Paul Eggert <address@hidden>
> 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

> 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 via email to

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