Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35896

Re: java.net.URLEncoder.encode + UTF-8 (rant)

From Daniele Futtorovic <da.futt.news@laposte.net>
Newsgroups comp.lang.java.programmer
Subject Re: java.net.URLEncoder.encode + UTF-8 (rant)
Date 2016-11-14 20:05 +0100
Organization A noiseless patient Spider
Message-ID <o0d1tp$sft$1@dont-email.me> (permalink)
References <slrno09hi9.456.avl@login.logic.tuwien.ac.at>

Show all headers | View raw


On 2016-10-17 14:38, Andreas Leitgeb wrote:
> <rant target="java.net.URLEncoder.encode(String s, String enc)">
> 
> This method should (according to the w3c) only be used with UTF-8
> and UTF-8 is always supposed to be supported by Java.
> 
> Why is there no java.net.URLEncoder.encodeUTF8(String s) that
> would free me from that boring
>   try {...} catch (UnsupportedEncodingException ign) {...}
> boilerplate?  (What code do good(tm) Java programmers even put
> into this catch clause, that is expected to never run, anyway?)

throw new AssertionError( ing.toString() );

But yeah, it's annoying.

df.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

java.net.URLEncoder.encode + UTF-8 (rant) Andreas Leitgeb <avl@logic.at> - 2016-10-17 12:38 +0000
  Re: java.net.URLEncoder.encode + UTF-8 (rant) j4n bur53 <janburse@fastmail.fm> - 2016-10-17 16:55 +0200
  Re: java.net.URLEncoder.encode + UTF-8 (rant) Arne Vajhøj <arne@vajhoej.dk> - 2016-10-19 21:35 -0400
  Re: java.net.URLEncoder.encode + UTF-8 (rant) Daniele Futtorovic <da.futt.news@laposte.net> - 2016-11-14 20:05 +0100
    Re: java.net.URLEncoder.encode + UTF-8 (rant) Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-11-14 14:45 -0500

csiph-web