{ "id": "153912", "key": "AC-1062", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2016-01-07T05:31:47.000+0000", "created": "2015-12-17T08:56:28.000+0000", "labels": [ "windows", "windows_phone" ], "versions": [], "issuelinks": [ { "id": "50369", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "154573", "key": "TIMOB-20288", "fields": { "summary": "Windows: File.write can't handle UTF-8 string", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "updated": "2016-04-29T17:00:33.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Reading plain text written in Japanese returns garbled characters.\r\n\r\n{code:java}\r\nvar filePath = Ti.Filesystem.applicationDataDirectory + \"test.txt\";\r\nvar file = Ti.Filesystem.getFile(filePath);\r\nfile.write(\"日本語 : Japanese\");\r\nalert(file.read());\r\n{code}\r\n\r\n", "attachment": [ { "id": "57800", "filename": "screenshot.png", "author": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-12-17T08:41:30.000+0000", "size": 95216, "mimeType": "image/png" } ], "flagged": false, "summary": "Ti.Filesystem.getFile(file).read() returns garbled multibyte string", "creator": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium 5.1.1\r\nWindows 10 64bit\r\nWindows Phone 8.1", "comment": { "comments": [ { "id": "373388", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Try writing the code as \r\n\r\n{code}\r\nvar log = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'test.txt');\r\n\r\n log.write('\"日本語 : Japanese\"'); \r\n \r\n alert(log.read().text);\r\n{code}\r\n\r\nHope this helps, Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2015-12-22T10:24:33.000+0000", "updated": "2015-12-22T10:24:33.000+0000" }, { "id": "373406", "author": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you, but it didn't solve the problem(same result).", "updateAuthor": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-12-22T15:13:29.000+0000", "updated": "2015-12-22T15:13:29.000+0000" }, { "id": "373454", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Try the below code\r\n\r\n{code}\r\nvar log = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'test.txt');\r\nlog.write('日本語 : Japanese'); \r\nalert(log.read().txt);\r\n{code}\r\n\r\nOr 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.\r\n\r\n\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2015-12-23T10:45:04.000+0000", "updated": "2015-12-23T10:45:04.000+0000" }, { "id": "374062", "author": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tried calling variable, single and double quotes, with no result.", "updateAuthor": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-08T07:16:46.000+0000", "updated": "2016-01-08T07:16:46.000+0000" }, { "id": "374063", "author": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "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.", "updateAuthor": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-08T07:25:05.000+0000", "updated": "2016-01-08T07:25:28.000+0000" }, { "id": "375481", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-29T02:06:54.000+0000", "updated": "2016-01-29T02:06:54.000+0000" }, { "id": "384344", "author": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks!", "updateAuthor": { "name": "toshiro", "key": "toshiro", "displayName": "Toshiro Yagi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-29T17:00:33.000+0000", "updated": "2016-04-29T17:00:33.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }