You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Benedikt Ritter <br...@apache.org> on 2013/08/30 16:45:42 UTC

[CSV] Use UTF-8 as the default Charset if no Charset is specified?

Hi,

in r1518802 [1] I have introduced some parameter validation. This was the
result of a discussion we had some time ago [2], where we agreed there
shouldn't be any fallbacks if null is passed to one of the static creation
methods on CSVParser. Now there is one method left that still uses a
fallback:

public static CSVParser parse(URL url, Charset charset, final CSVFormat
format)

This method falls back to Charset.forName("UTF-8") if null is passed in for
charset. Since other methods don't use fall backs I wonder if we should
remove the fallback logic here as well.

Benedikt

[1] http://svn.apache.org/r1518802
[2] http://markmail.org/message/rajn6auovzc55w4r


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Re: [CSV] Use UTF-8 as the default Charset if no Charset is specified?

Posted by Benedikt Ritter <br...@apache.org>.
I have removed the fallback in revision 1519269.


2013/8/31 Gary Gregory <ga...@gmail.com>

> On Fri, Aug 30, 2013 at 10:45 AM, Benedikt Ritter <britter@apache.org
> >wrote:
>
> > Hi,
> >
> > in r1518802 [1] I have introduced some parameter validation. This was the
> > result of a discussion we had some time ago [2], where we agreed there
> > shouldn't be any fallbacks if null is passed to one of the static
> creation
> > methods on CSVParser. Now there is one method left that still uses a
> > fallback:
> >
> > public static CSVParser parse(URL url, Charset charset, final CSVFormat
> > format)
> >
> > This method falls back to Charset.forName("UTF-8") if null is passed in
> for
> > charset. Since other methods don't use fall backs I wonder if we should
> > remove the fallback logic here as well.
> >
>
> +1 for consistency.
>
> Gary
>
>
> > Benedikt
> >
> > [1] http://svn.apache.org/r1518802
> > [2] http://markmail.org/message/rajn6auovzc55w4r
> >
> >
> > --
> > http://people.apache.org/~britter/
> > http://www.systemoutprintln.de/
> > http://twitter.com/BenediktRitter
> > http://github.com/britter
> >
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<
> http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Re: [CSV] Use UTF-8 as the default Charset if no Charset is specified?

Posted by Gary Gregory <ga...@gmail.com>.
On Fri, Aug 30, 2013 at 10:45 AM, Benedikt Ritter <br...@apache.org>wrote:

> Hi,
>
> in r1518802 [1] I have introduced some parameter validation. This was the
> result of a discussion we had some time ago [2], where we agreed there
> shouldn't be any fallbacks if null is passed to one of the static creation
> methods on CSVParser. Now there is one method left that still uses a
> fallback:
>
> public static CSVParser parse(URL url, Charset charset, final CSVFormat
> format)
>
> This method falls back to Charset.forName("UTF-8") if null is passed in for
> charset. Since other methods don't use fall backs I wonder if we should
> remove the fallback logic here as well.
>

+1 for consistency.

Gary


> Benedikt
>
> [1] http://svn.apache.org/r1518802
> [2] http://markmail.org/message/rajn6auovzc55w4r
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory