Changeset 35676 in osm for applications


Ignore:
Timestamp:
2021-01-04T22:32:30+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #20259 - load charsets dynamically

Location:
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoCharset.java

    r33642 r35676  
    55import java.nio.charset.StandardCharsets;
    66import java.util.Objects;
     7import java.util.function.Supplier;
    78
    89/**
     
    1112 */
    1213enum EdigeoCharset {
    13     ISO_646_IRV("IRV", StandardCharsets.US_ASCII),
    14     ISO_646_FRANCE("646-FRANCE", StandardCharsets.ISO_8859_1),
    15     ISO_8859_1("8859-1", StandardCharsets.ISO_8859_1),
    16     ISO_8859_2("8859-2", Charset.forName("ISO-8859-2")),
    17     ISO_8859_3("8859-3", Charset.forName("ISO-8859-3")),
    18     ISO_8859_4("8859-4", Charset.forName("ISO-8859-4")),
    19     ISO_8859_5("8859-5", Charset.forName("ISO-8859-5")),
    20     ISO_8859_6("8859-6", Charset.forName("ISO-8859-6")),
    21     ISO_8859_7("8859-7", Charset.forName("ISO-8859-7")),
    22     ISO_8859_8("8859-8", Charset.forName("ISO-8859-8")),
    23     ISO_8859_9("8859-9", Charset.forName("ISO-8859-9"));
     14    ISO_646_IRV("IRV", () -> StandardCharsets.US_ASCII),
     15    ISO_646_FRANCE("646-FRANCE", () -> StandardCharsets.ISO_8859_1),
     16    ISO_8859_1("8859-1", () -> StandardCharsets.ISO_8859_1),
     17    ISO_8859_2("8859-2", () -> Charset.forName("ISO-8859-2")),
     18    ISO_8859_3("8859-3", () -> Charset.forName("ISO-8859-3")),
     19    ISO_8859_4("8859-4", () -> Charset.forName("ISO-8859-4")),
     20    ISO_8859_5("8859-5", () -> Charset.forName("ISO-8859-5")),
     21    ISO_8859_6("8859-6", () -> Charset.forName("ISO-8859-6")),
     22    ISO_8859_7("8859-7", () -> Charset.forName("ISO-8859-7")),
     23    ISO_8859_8("8859-8", () -> Charset.forName("ISO-8859-8")),
     24    ISO_8859_9("8859-9", () -> Charset.forName("ISO-8859-9"));
    2425    //ISO_6937_JEC("JEC");
    2526
    2627    final String zv;
    27     final Charset cs;
     28    final Supplier<Charset> cs;
    2829
    29     EdigeoCharset(String zv, Charset cs) {
     30    EdigeoCharset(String zv, Supplier<Charset> cs) {
    3031        this.zv = Objects.requireNonNull(zv, "zv");
    3132        this.cs = Objects.requireNonNull(cs, "cs");
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoFile.java

    r34355 r35676  
    137137    private boolean bomFound;
    138138    private boolean eomFound;
    139     EdigeoCharset charset;
     139    private EdigeoCharset charset;
    140140    private Block currentBlock;
    141141
Note: See TracChangeset for help on using the changeset viewer.