Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prql integration fails on non-English Windows system/query #143

Open
nickolay opened this issue Jan 26, 2025 · 1 comment
Open

prql integration fails on non-English Windows system/query #143

nickolay opened this issue Jan 26, 2025 · 1 comment

Comments

@nickolay
Copy link

When executing a prql query that contains non-english characters, such as "фы", I get the Non-zero exit value for runArgs:stream did not contain valid UTF-8 error.

The error seems to originate here:

BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdin));
writer.write(qry);
writer.close();
StringBuilder sb = new StringBuilder();
StringBuilder errSb = new StringBuilder();
String line = null;
while ( (line = reader.readLine()) != null) {
sb.append(line);
sb.append(System.getProperty("line.separator"));
}
reader.close();
while ((line = bre.readLine()) != null) {
System.err.println(line);
errSb.append(line);

"stream did not contain valid UTF-8" is probably a rust error, complaining about whatever it received on stdin.

OutputStreamWriter docs say it uses the "default" encoding when not explicitly specified.

If I run java -Dfile.encoding=UTF-8 -cp "c:\Progra~2\TimeStored.com\qstudio.jar;c:\Progra~2\TimeStored.com\libs\*" com.timestored.qstudio.QStudioLauncher, everything works as expected

As common for a non-english system, I have "Current language for non-Unicode programs" configured in Windows, with the UTF-8 checkbox NOT selected.

Should the OutputStreamWriter's encoding be explicitly specified as UTF-8, if that's what prqlc expects? Claude suggests:

BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdin, StandardCharsets.UTF_8));
@nickolay
Copy link
Author

Oh, just realized this also applies to InputStreamReader: before specifying -Dfile.encoding=UTF-8, the error lines printed by prqlc were not displaying correctly in qstudio's output pane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant