sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1777272 - /sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
Date Wed, 04 Jan 2017 09:43:13 GMT
Author: desruisseaux
Date: Wed Jan  4 09:43:13 2017
New Revision: 1777272

URL: http://svn.apache.org/viewvc?rev=1777272&view=rev
Log:
Preserve the data encoding with a conversion from legacy ISO 191115 CharacterSet to JDK Charset.

Modified:
    sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java?rev=1777272&r1=1777271&r2=1777272&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
[UTF-8] Wed Jan  4 09:43:13 2017
@@ -85,6 +85,7 @@ import static java.util.Collections.sing
 import static org.apache.sis.internal.util.StandardDateFormat.MILLISECONDS_PER_DAY;
 
 // Branch-dependent imports
+import org.opengis.metadata.identification.CharacterSet;
 import org.apache.sis.internal.jdk8.LocalDate;
 import org.apache.sis.internal.jdk8.JDK8;
 import org.apache.sis.feature.DefaultFeatureType;
@@ -715,7 +716,9 @@ public class MetadataBuilder {
         ArgumentChecks.ensureNonNull("scope", scope);
         if (encoding != null) {
             // No need to use 'addIfNotPresent(…)' because Charset collection is a Set
by default.
-            if (scope != Scope.DATA) metadata().getCharacterSets().add(encoding);
+            if (scope != Scope.DATA)           metadata().getCharacterSets().add(encoding);
+            if (scope != Scope.METADATA) identification().getCharacterSets().add(
+                    Types.forCodeName(CharacterSet.class, encoding.toString(), true));
         }
     }
 



Mime
View raw message