Default the encoding of clipboard data to UTF-8.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@2390 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
07ba5cf27b
commit
76802d328d
@ -224,11 +224,16 @@ public class ImportingUtilities {
|
|||||||
String name = fileItem.getFieldName().toLowerCase();
|
String name = fileItem.getFieldName().toLowerCase();
|
||||||
if (fileItem.isFormField()) {
|
if (fileItem.isFormField()) {
|
||||||
if (name.equals("clipboard")) {
|
if (name.equals("clipboard")) {
|
||||||
|
String encoding = request.getCharacterEncoding();
|
||||||
|
if (encoding == null) {
|
||||||
|
encoding = "UTF-8";
|
||||||
|
}
|
||||||
|
|
||||||
File file = allocateFile(rawDataDir, "clipboard.txt");
|
File file = allocateFile(rawDataDir, "clipboard.txt");
|
||||||
|
|
||||||
JSONObject fileRecord = new JSONObject();
|
JSONObject fileRecord = new JSONObject();
|
||||||
JSONUtilities.safePut(fileRecord, "origin", "clipboard");
|
JSONUtilities.safePut(fileRecord, "origin", "clipboard");
|
||||||
JSONUtilities.safePut(fileRecord, "declaredEncoding", request.getCharacterEncoding());
|
JSONUtilities.safePut(fileRecord, "declaredEncoding", encoding);
|
||||||
JSONUtilities.safePut(fileRecord, "declaredMimeType", (String) null);
|
JSONUtilities.safePut(fileRecord, "declaredMimeType", (String) null);
|
||||||
JSONUtilities.safePut(fileRecord, "format", "text");
|
JSONUtilities.safePut(fileRecord, "format", "text");
|
||||||
JSONUtilities.safePut(fileRecord, "fileName", "(clipboard)");
|
JSONUtilities.safePut(fileRecord, "fileName", "(clipboard)");
|
||||||
|
Loading…
Reference in New Issue
Block a user