0 Replies Latest reply on Jan 31, 2013 3:09 AM by Marc Autret

    [BUG] Split() and replace() issues with U+0000

    Marc Autret Level 4

      Hi everyone,

       

      • I just posted an article about String.prototype.split() malfunction in ExtendScript CS4 when the source string contains one or more NUL character. A patch is provided. Feel free to make your own observations and/or report a bug.

      http://www.indiscripts.com/post/2013/01/making-string-split-support-u0000-in-extendscript- cs4

       

      • Meanwhile, String.prototype.replace() happens to have a similar ***** in the armor, and it looks like all ExtendScript engines are then affected:

       

      var s = "A\x00B\x00C";
      
      alert( s.replace('A','Z').toSource() );
      // => (new String("Z\x00\x00B\x00"))  !
      
      alert( s.replace('B','Z').toSource() );
      // => (new String("A\x00Z\x00\x00"))  !
      
      alert( s.replace('\x00',' ').toSource() );
      // => (new String(" A\x00B\x00C"))    !
      

       

      @+

      Marc