TruckMovers / cordova-plugin-remote-injection

DEPRECATED: Cordova plugin to allow a remote site to interact with cordova's javascript APIs when loaded within a cordova app.
Apache License 2.0
91 stars 95 forks source link

utf-8 support #13

Closed fevxie closed 7 years ago

fevxie commented 8 years ago

Hi:

I use this plugin inject a javascript file on the remote website, it worked perfect. But when I write some none ascii chars in the javascript file, on the Android platform, I found the none ascii chars display wrong. I think maybe the problem should be settled on this plugin?

the javascript like :

navigator.notification.alert(
                message,    // message
                null,       // callback
                "", // title
                '确定'        // buttonName
            );

I use none ascii code on the button name, please give me some advices.

Thanks.

bradleyjames commented 8 years ago

Is this a JS file that you're providing? If so try setting the file's encoding to UTF-8 as described in this SO post. Let me know what happens.

fevxie commented 8 years ago

hi, @bradleyjames :

yes, this is my own js file using to reject into remote website. Trying the method you suggested, but It doesn't work.

PS: the issues only exist on android platform, iOS platform doesn't have this issues.

Attach file: the result of alter output when using unicode char.

layout

bradleyjames commented 8 years ago

I was able to reproduce. I'll try to figure out what's going on.

bradleyjames commented 7 years ago

Thanks for the PR! It's been merged and I released v0.4.1 to npm.