Révision 2552
tmp/org.txm.utils/src/org/txm/utils/AsciiUtils.java (revision 2552) | ||
---|---|---|
76 | 76 |
private AsciiUtils() { |
77 | 77 |
} |
78 | 78 |
|
79 |
public static Transliterator asciiFormmater = Transliterator.getInstance("Any-Latin; NFD; [^\\p{Alnum}] Remove"); |
|
80 |
|
|
79 | 81 |
// remove accentued from a string and replace with ascii equivalent |
80 | 82 |
/** |
81 | 83 |
* Convert non ascii. |
... | ... | |
88 | 90 |
if (s == null) |
89 | 91 |
return null; |
90 | 92 |
|
91 |
String id = "Any-Latin; NFD; [^\\p{Alnum}] Remove"; |
|
92 |
String latin = Transliterator.getInstance(id).transform(s); |
|
93 |
String latin = asciiFormmater.transform(s); |
|
93 | 94 |
|
94 | 95 |
// StringBuilder sb = new StringBuilder(); |
95 | 96 |
// int n = s.length(); |
Formats disponibles : Unified diff