Bug in ASCIIEncoding.GetBytes [SOLVED]
Posted: Thu Sep 10, 2015 11:46 am
Hello,
ASCIIEncoding.GetBytes works under Windows.
In Java I got a NullReferenceException at "this.fallbackCharacter" :
this solves the issue (for the moment) :
Regards
Uwe
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