You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
failed to match a command for {"callback":"499c79fd-8dde-4720-e708-d94956083059","error":"b4aa06f4-a06f-45b1-66d5-b69bdc463d43","cmd":"writeFile","path":"unicodeTest.txt","contents":"å","options":{"dir":2}}], trailing characters at line 1 column 178
Expected behavior
The file contents are written without error.
Platform and Versions (please complete the following information):
let arg = arg.chars().skip(1).take(arg.len() - 2).collect::<String>();
Likely the use of .chars() breaks the behavior: per https://doc.rust-lang.org/std/string/struct.String.html#method.chars , the behavior might not be what we want here: .chars() iterates over Unicode Scalar Value instead (while arg.len() returns the byte length). Notice the example above
..."options":{"dir":2}}] // final ']' failed to be removed. This should have been removed
(I cannot try working on a fix myself due to some legal personal reasons atm, but hopefully this observation can help)
Update: I made a small mistake before, but it is still Unicode issue. Tested and seems replacing arg.len() with arg.chars().count() should work.
Describe the bug
Using
writeFile
API with unicode payload results infailed to match a command
error.To Reproduce
Implement a minimal function:
Receive the subsequent error in WebView console:
Expected behavior
The file contents are written without error.
Platform and Versions (please complete the following information):
OS: macOS 10.14.6
Node: 12.18.0
NPM: 6.14.4
Yarn: -
Rustc: 1.45.0
taurijs: 0.11.0 (also appears in 0.10.0)
tauri.rs: 0.9.0 (also appears in 0.8.0)
Additional context
I realize that I have only been trying this in dev.
The text was updated successfully, but these errors were encountered: