Issue 486 - make sure project character encoding doesn't get set to ""

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2381 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2011-11-18 20:52:49 +00:00
parent d5dd04965a
commit 80c13e4b59

View File

@ -912,7 +912,12 @@ public class ImportingUtilities {
) {
ProjectMetadata pm = new ProjectMetadata();
pm.setName(JSONUtilities.getString(optionObj, "projectName", "Untitled"));
pm.setEncoding(JSONUtilities.getString(optionObj, "encoding", "UTF-8"));
String encoding = JSONUtilities.getString(optionObj, "encoding", "UTF-8");
if ("".equals(encoding)) {
// encoding can be present, but empty, which won't trigger JSONUtilities default processing
encoding = "UTF-8";
}
pm.setEncoding(encoding);
record.parser.parse(
project,