*/
package org.apache.poi.hssf.record;
+import java.util.Arrays;
+
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianOutput;
-
-import java.util.Arrays;
+import org.apache.poi.util.StringUtil;
/**
* DConRef records specify a range in a workbook (internal or external) that serves as a data source
{
offset++;
}
- String out = new String(Arrays.copyOfRange(path, offset, path.length));
+ String out = new String(Arrays.copyOfRange(path, offset, path.length), StringUtil.UTF8);
//UNC paths have \u0003 chars as path separators.
out = out.replaceAll("\u0003", "/");
return out;
parts[i] = specs.get(i).valueFor(elapsed);
}
- Formatter formatter = new Formatter(toAppendTo);
+ Formatter formatter = new Formatter(toAppendTo, Locale.ROOT);
try {
formatter.format(printfFmt, parts);
} finally {
*
* Note - none of the methods in this class deals with {@link org.apache.poi.hssf.record.ContinueRecord}s.
* For such functionality, consider using {@link RecordInputStream}
- *
- *
- *@author Andrew C. Oliver
- *@author Sergei Kozello (sergeikozello at mail.ru)
- *@author Toshiaki Kamoshida (kamoshida.toshiaki at future dot co dot jp)
*/
public class StringUtil {
- private static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
- private static final Charset UTF16LE = Charset.forName("UTF-16LE");
+ protected static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
+ protected static final Charset UTF16LE = Charset.forName("UTF-16LE");
+ public static final Charset UTF8 = Charset.forName("UTF-8");
+
private static Map<Integer,Integer> msCodepointToUnicode;
private StringUtil() {