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

command.stdout.on() gets empty string when responses contain Chinses characters(Windows) #2673

Closed
brsmsg opened this issue Sep 28, 2021 · 3 comments

Comments

@brsmsg
Copy link

brsmsg commented Sep 28, 2021

Describe the bug

In our App, we use a java program to write JSON string into a standard IO stream, and we use listener to track the stream through command.stdout.on("data", (data) => { console.log(data) }).
There are some Chinese characters in the response data and we lost the response in this API (the terminal shows an empty strings).
Such a problem only exists when responses contain some Chinese characters on Windows. On macOS and Ubuntu, it works well.
We also tested our API directly using Node.js on Windows and we got the Chinese content correctly.

To Reproduce

Steps to reproduce the behavior:
use command.stdout.on("data", (data) => { console.log(data) }) and data string has some Chinses characters.

Expected behavior

command.stdout.on() can get Chinese characters correctly. If there are some encoding problems, at least the api can get us some Chinese Garbled instead of an empty string.

Platform and Versions (required):

Operating System - Windows version 10.0.18363.535  X64

Node.js environment
Node.js - 14.16.0
@tauri-apps/cli - 1.0.0-beta.10
@tauri-apps/api - 1.0.0-beta.8

Global packages
npm - 6.14.11
pnpm - 6.0.2

Rust environment
rustc - 1.54.0
cargo - 1.54.0

App directory structure
/.git
/.vscode
/dist
/node_modules
/public
/release
/src
/src-tauri

App
tauri.rs - 1.0.0-beta.8
build-type - bundle
CSP - default-src blob: data: filesystem: ws: wss: asset: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
distDir - ../dist
@YNVoon
Copy link

YNVoon commented Apr 16, 2022

Is there any alternative workaround? I am having this issue when my Windows language is in Chinese.

@lucasfernog
Copy link
Member

Unfortunately I tried to fix this a year ago but it was super complicated :( Windows attacks again.

@lucasfernog
Copy link
Member

Fixed by #4772

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

No branches or pull requests

4 participants