Writing files with commas in the string - resulting file is truncated at the comma

Using capacitor filesystem plugin, when trying to do this on android:

Filesystem.writeFile({
      data: 'data,that,contains,commas',
      path: fileName,
      encoding: FilesystemEncoding.UTF16,
      directory: FilesystemDirectory.Documents       
    }).then((result) => {
...
});

…the text written to the file is

that

Any ideas?

Thanks.

What’s your Capacitor version? that was supposedly fixed long ago.

$ ionic info

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (C:\Users\dunca\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.3.1
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.3.8
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.5.1

Capacitor:

   capacitor (Capacitor CLI) : 1.0.0-beta.22
   @capacitor/core           : 1.0.0-beta.22

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (1 plugins total)

System:

   NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

That doesn’t show the @capacitor/android version (you can check the package.json file).
But considering you are using beta 22 for cli and core you are probably using the same version for android too, so update to 1.1.1, just released it today and have that issue fixed.

Excellent…thanks mate, the upgrade sorted it.

I know this is an ancient issue, but I am using Capacitor version 2.1.0 and still having this issue. Any idea why this would be happening still?

the issue might have been reintroduced, create a new issue providing a sample app where it can be reproduced