You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2014/11/11 15:29:45 UTC

svn commit: r1638121 - /commons/proper/csv/trunk/src/site/xdoc/user-guide.xml

Author: ggregory
Date: Tue Nov 11 14:29:44 2014
New Revision: 1638121

URL: http://svn.apache.org/r1638121
Log:
Better BOM docs.

Modified:
    commons/proper/csv/trunk/src/site/xdoc/user-guide.xml

Modified: commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/site/xdoc/user-guide.xml?rev=1638121&r1=1638120&r2=1638121&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/site/xdoc/user-guide.xml (original)
+++ commons/proper/csv/trunk/src/site/xdoc/user-guide.xml Tue Nov 11 14:29:44 2014
@@ -50,6 +50,15 @@ try {
     parser.close();
     reader.close();
 }</source>
+  <p>
+    You might find it handy to create something like this:    
+  </p>
+  <source>/**
+ * Creates a reader capable of handling BOMs.
+ */
+public InputStreamReader newReader(final InputStream inputStream) {
+    return new InputStreamReader(new BOMInputStream(inputStream), StandardCharsets.UTF_8);
+}</source>
 </section>
 <section name="Printing with headers">
   <p>



Re: svn commit: r1638121 - /commons/proper/csv/trunk/src/site/xdoc/user-guide.xml

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Nov 11, 2014 at 10:02 AM, Benedikt Ritter <br...@apache.org>
wrote:

> 2014-11-11 15:29 GMT+01:00 <gg...@apache.org>:
>
> > Author: ggregory
> > Date: Tue Nov 11 14:29:44 2014
> > New Revision: 1638121
> >
> > URL: http://svn.apache.org/r1638121
> > Log:
> > Better BOM docs.
> >
> > Modified:
> >     commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
> >
> > Modified: commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
> > URL:
> >
> http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/site/xdoc/user-guide.xml?rev=1638121&r1=1638120&r2=1638121&view=diff
> >
> >
> ==============================================================================
> > --- commons/proper/csv/trunk/src/site/xdoc/user-guide.xml (original)
> > +++ commons/proper/csv/trunk/src/site/xdoc/user-guide.xml Tue Nov 11
> > 14:29:44 2014
> > @@ -50,6 +50,15 @@ try {
> >      parser.close();
> >      reader.close();
> >  }</source>
> > +  <p>
> > +    You might find it handy to create something like this:
> > +  </p>
> > +  <source>/**
> > + * Creates a reader capable of handling BOMs.
> > + */
> > +public InputStreamReader newReader(final InputStream inputStream) {
> > +    return new InputStreamReader(new BOMInputStream(inputStream),
> > StandardCharsets.UTF_8);
> >
>
> StandardCharsets is Java 7, but csv is Java 6 :-(
>

Indeed, but this is an example only.

Gary

>
>
> > +}</source>
> >  </section>
> >  <section name="Printing with headers">
> >    <p>
> >
> >
> >
>
>
> --
> 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

Re: svn commit: r1638121 - /commons/proper/csv/trunk/src/site/xdoc/user-guide.xml

Posted by Benedikt Ritter <br...@apache.org>.
2014-11-11 15:29 GMT+01:00 <gg...@apache.org>:

> Author: ggregory
> Date: Tue Nov 11 14:29:44 2014
> New Revision: 1638121
>
> URL: http://svn.apache.org/r1638121
> Log:
> Better BOM docs.
>
> Modified:
>     commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
>
> Modified: commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
> URL:
> http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/site/xdoc/user-guide.xml?rev=1638121&r1=1638120&r2=1638121&view=diff
>
> ==============================================================================
> --- commons/proper/csv/trunk/src/site/xdoc/user-guide.xml (original)
> +++ commons/proper/csv/trunk/src/site/xdoc/user-guide.xml Tue Nov 11
> 14:29:44 2014
> @@ -50,6 +50,15 @@ try {
>      parser.close();
>      reader.close();
>  }</source>
> +  <p>
> +    You might find it handy to create something like this:
> +  </p>
> +  <source>/**
> + * Creates a reader capable of handling BOMs.
> + */
> +public InputStreamReader newReader(final InputStream inputStream) {
> +    return new InputStreamReader(new BOMInputStream(inputStream),
> StandardCharsets.UTF_8);
>

StandardCharsets is Java 7, but csv is Java 6 :-(


> +}</source>
>  </section>
>  <section name="Printing with headers">
>    <p>
>
>
>


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