cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Luckow (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-8792) Windows Phone 8 only: File Plugin: readAsText leads to object instead string
Date Fri, 03 Apr 2015 11:15:53 GMT
Martin Luckow created CB-8792:
---------------------------------

             Summary: Windows Phone 8 only: File Plugin: readAsText leads to object instead
string
                 Key: CB-8792
                 URL: https://issues.apache.org/jira/browse/CB-8792
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin File, Windows 8
    Affects Versions: 3.4.0
         Environment: Windows 8.1, Visual Studio with Cordova, Emulators, native Devices
            Reporter: Martin Luckow
            Assignee: Jesse MacFadyen


I have to read and write local JSON-Files in my Cordova-Project. I use the current and previous
versions of File-Plugin.
Writing works fine under all platforms.
Reading under iOS and Android and Windows 8.1 works.
Reading under Windows Phone 8 (device and emulator) has a strange effect: instead of getting
a string I get the already decoded object stored in the JSON-File

...
function GotFileEntry(fileEntry) {
  fileEntry.file(GotFile, Fail);
  function GotFile(file) {
    var reader = new FileReader();
    reader.onload = function (evt) {
      // Here evt.target.result is the already object decoded object instead a string.
    };
    reader.onerror = function (evt) {
       // No error occurs
    };
    reader.readAsText(file);
}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message