ASCIIEncoding.GetBytes works under Windows.
In Java I got a NullReferenceException at "this.fallbackCharacter" :
Code: Select all
JSIL.ImplementExternals("System.Text.ASCIIEncoding", function ($) {
$.RawMethod(false, "$encode", function ASCIIEncoding_Encode (string, outputBytes, outputIndex) {
var writer = this.$makeWriter(outputBytes, outputIndex);
var fallbackCharacter = this.fallbackCharacter.charCodeAt(0);
var reader = this.$makeCharacterReader(string), ch;
this solves the issue (for the moment) :
Code: Select all
JSIL.ImplementExternals("System.Text.ASCIIEncoding", function ($) {
$.RawMethod(false, "$encode", function ASCIIEncoding_Encode (string, outputBytes, outputIndex) {
var writer = this.$makeWriter(outputBytes, outputIndex);
if ( this.fallbackCharacter == null) {
this.fallbackCharacter = "?";
}
var fallbackCharacter = this.fallbackCharacter.charCodeAt(0);
var reader = this.$makeCharacterReader(string), ch;
Regards
Uwe