View Javadoc

1   package com.loribel.commons.abstraction;
2   
3   /***
4    * Constants class.
5    * 
6    * @author Gregory Borelli
7    */
8   public abstract class ENCODING
9   {
10      public static final String UTF8 = "UTF-8";
11      public static final String ISO_8859_1 = "ISO-8859-1";
12      public static String DEFAULT = ISO_8859_1;
13      public static final String LOCALE;
14  
15      static {
16          String l_encoding = System.getProperty("file.encoding");// non official property
17          if ("Cp1252".equals(l_encoding)) {
18              l_encoding = ISO_8859_1;
19          }
20          LOCALE = l_encoding;
21      }
22      /*
23       static {
24       //System.getProperty("file.encoding"); / non official property
25       OutputStreamWriter l_outputStreamWriter = new OutputStreamWriter(
26       new ByteArrayOutputStream(1));
27       LOCALE = l_outputStreamWriter.getEncoding();
28       
29       // Sur Linux lews deux manières ne retourne pas la même chose 
30       // System.getProperty("file.encoding") => UTF-8
31       // Autre OutputStreamWriter => UTF8 
32       }
33       */
34  }