[AC-1062] Ti.Filesystem.getFile(file).read() returns garbled multibyte string
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2016-01-07T05:31:47.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | windows, windows_phone |
Reporter | Toshiro Yagi |
Assignee | Sharif AbuDarda |
Created | 2015-12-17T08:56:28.000+0000 |
Updated | 2016-04-29T17:00:33.000+0000 |
Description
Reading plain text written in Japanese returns garbled characters.
var filePath = Ti.Filesystem.applicationDataDirectory + "test.txt";
var file = Ti.Filesystem.getFile(filePath);
file.write("日本語 : Japanese");
alert(file.read());
Attachments
File | Date | Size |
---|---|---|
screenshot.png | 2015-12-17T08:41:30.000+0000 | 95216 |
Hello, Try writing the code as
Hope this helps, Thanks.
Thank you, but it didn't solve the problem(same result).
Hello, Try the below code
Or you can first define a variable like "var str1 = '日本語 : Japanese';" and to call the variable as "log.write(str1)"; Use double " or both if necessary. Reply with your findings. Thanks.
Tried calling variable, single and double quotes, with no result.
Since JavaScript code is right and works on other platforms, please don't mark this issue as resolved as long as returning garbled data is not an acceptable behavior. Thanks.
Thanks!