Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<action type="fix" dev="ggregory" due-to="Cassio Santos">Remove broken website link #577.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix Apache RAT plugin console warnings.</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory, Indy, Sylvia van Os" issue="CSV-307">Add an "Android Compatibility" section to the web site.</action>
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump org.apache.commons:commons-parent from 85 to 96 #573, #595.</action>
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">[test] Bump com.opencsv:opencsv from 5.11.2 to 5.12.0 #558.</action>
Expand Down
31 changes: 21 additions & 10 deletions src/site/xdoc/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ limitations under the License.
<image src="/images/logo.png"/>
</bannerRight>
<body>
<!-- ================================================== -->
<section name="Using Apache Commons CSV">
<p>Commons CSV reads and writes files in variations of the Comma Separated Value (CSV) format.</p>
<p>Read the documentation starting with the <a href="apidocs/index.html">Javadoc Overview</a>.</p>
</section>
<!-- ================================================== -->
<section name="Documentation">
<p>
An overview of the functionality is provided in the
Expand All @@ -48,7 +46,6 @@ The <a href="scm.html">git repository</a> can be
<a href="https://gitbox.apache.org/repos/asf?p=commons-csv.git">browsed</a>.
</p>
</section>
<!-- ================================================== -->
<section name="Releases">
<ul>
<li><a href="https://commons.apache.org/csv/download_csv.cgi">Download Apache Commons CSV current (mirrors)</a>, requires Java 8 or above</li>
Expand All @@ -69,13 +66,32 @@ For previous releases, see the <a href="https://archive.apache.org/dist/commons/
For dependency access methods, see <a href="dependency-info.html">Dependency Information</a>
</p>
</section>

<section name="Building from sources">
<p>The latest code can be checked out from our git repository at <a href="https://gitbox.apache.org/repos/asf/commons-csv.git">https://gitbox.apache.org/repos/asf/commons-csv.git</a>.
You can build the component using Apache Maven using <code>mvn clean package</code>.
</p>
</section>
<!-- ================================================== -->
<section name="Android Compatibility">
<p>
Apache Commons CSV requires Java 8 or above.
</p>
<table>
<thead>
<tr>
<th>Commons CSV</th>
<th>Java</th>
<th>Android</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.10.0+</td>
<td>8</td>
<td><a href="https://developer.android.com/tools/releases/platforms#7.0">Android 7.0 (API level 24)</a></td>
</tr>
</tbody>
</table>
</section>
<section name="Getting Involved">
<p>
The <a href="mail-lists.html">commons developer mailing list</a> is the main channel of communication for contributors. Please remember that the lists are shared between all commons components, so prefix your email by [csv]. </p>
Expand All @@ -87,7 +103,6 @@ For previous releases, see the <a href="https://archive.apache.org/dist/commons/
<p>Alternatively you can go through the <em>Needs Work</em> tags in the <a href="taglist.html">TagList report</a>.</p>
<p>If you'd like to offer up pull requests via GitHub rather than applying patches to JIRA, we have a <a href="https://github.com/apache/commons-csv/">GitHub mirror</a>. </p>
</section>
<!-- ================================================== -->
<section name="Support">
<p>
The <a href="mail-lists.html">commons mailing lists</a> act as the main support forum.
Expand All @@ -101,8 +116,6 @@ For previous releases, see the <a href="https://archive.apache.org/dist/commons/
Please read the instructions carefully.
</p>
</section>
<!-- ================================================== -->

<section name="About Commons CSV">
<p>Commons CSV was started to unify a common and simple interface for reading and writing CSV files under an ASL license. It has been bootstrapped by a code donation from Netcetera in Switzerland. There are three pre-existing BSD compatible CSV parsers which this component will hopefully make redundant (authors willing): </p>
<ul>
Expand All @@ -116,7 +129,5 @@ For previous releases, see the <a href="https://archive.apache.org/dist/commons/
<li><a href="https://super-csv.github.io/super-csv/index.html">Super CSV</a></li>
</ul>
</section>

<!-- ================================================== -->
</body>
</document>
49 changes: 49 additions & 0 deletions src/test/java/org/apache/commons/csv/issues/JiraCsv227Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.commons.csv.issues;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;

import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
import org.apache.commons.csv.QuoteMode;
import org.junit.jupiter.api.Test;

/**
* Tests https://issues.apache.org/jira/browse/CSV-227
*/
class JiraCsv227Test {

@Test
public void test() throws IOException {
final StringBuilder out = new StringBuilder();
try (CSVPrinter printer = new CSVPrinter(out, CSVFormat.DEFAULT.withQuoteMode(QuoteMode.MINIMAL))) {
printer.printRecord("ㅁㅎㄷㄹ", "ㅁㅎㄷㄹ", "", "test2");
printer.printRecord("한글3", "hello3", "3한글3", "test3");
printer.printRecord("", "hello4", "", "test4");
}
// ㅁㅎㄷㄹ,ㅁㅎㄷㄹ,,test2
// 한글3,hello3,3한글3,test3
// "",hello4,,test4
assertEquals("ㅁㅎㄷㄹ,ㅁㅎㄷㄹ,,test2\r\n한글3,hello3,3한글3,test3\r\n\"\",hello4,,test4\r\n", out.toString());
}
}