For reinterpret function, swapped encoder and decoder arguments if decoder is specified, as discussed here:

http://groups.google.com/group/google-refine/msg/629dbf11b073e129

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2392 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2011-11-29 19:55:08 +00:00
parent 3b4bdbecdf
commit d419f4bbc7

View File

@ -58,14 +58,13 @@ public class Reinterpret implements Function {
String decoder;
String encoder;
encoder = (String) o2;
if (args.length == 2) {
Project project = (Project) bindings.get("project");
ProjectMetadata metadata = ProjectManager.singleton.getProjectMetadata(project.id);
decoder = metadata.getEncoding(); // can return "" for broken projects
encoder = (String) o2;
} else {
decoder = (String) o2;
encoder = (String) args[2];
decoder = (String) args[2];
}
return reinterpret(str, decoder, encoder);
}