Bug in ASCIIEncoding.GetBytes [SOLVED]

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

Bug in ASCIIEncoding.GetBytes [SOLVED]

Postby CyborgDE » Thu Sep 10, 2015 11:46 am

Hello,

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

JS-Support @Userware
Site Admin
Posts: 1093
Joined: Tue Apr 08, 2014 3:42 pm

Re: Bug in ASCIIEncoding.GetBytes

Postby JS-Support @Userware » Wed Sep 16, 2015 7:53 am

Hello,

Thanks a lot for the contribution!

We have just added it to the upcoming Beta 5.

Regards,
JS-Support


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest

 

 

cron