On Thu, Apr 19, 2018 at 9:35 PM,  <nekkets...@gmail.com> wrote:
>
> i noticed that html/template escapes a URI using small letters. For example,
> the following code outputs "%e5%af%bf%e5%8f%b8", not "%E5%AF%BF%E5%8F%B8".
>
> t, _ := template.New("foo").Parse(`{{define "T"}}<a
> href="/{{.}}"></a>{{end}}`)
> t.ExecuteTemplate(os.Stdout, "T", "寿司")
> (See https://play.golang.org/p/9caza-3ojur )
>
> This behavior is different from what template.URLQueryEscaper does. Also,
> this is invalid with URL Standard (
> https://url.spec.whatwg.org/#percent-encoded-bytes ). RFC 3986 Section 2.1
> says "For consistency, URI producers and normalizers should use uppercase
> hexadecimal digits for all percent-encodings."
>
> It seems that this line generates these small letters. So we can fix this
> just by changing x to X.
>
> But this behavior has remained for several years. Therefore I want to
> confirm that this should be fixed, before filing an issue or sending a pull
> req. Am I missing something?

I guess we should try following the RFC.  Thanks.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to