bugGnash - The GNU Flash player - Bugs: bug #21400, Special chars in strings are not...

 
 

bug #21400: Special chars in strings are not handled correctly

Submitted by:  Udo Giacomozzi <udog>
Submitted on:  Tue 23 Oct 2007 01:44:45 PM UTC  
 
Category: ActionScriptSeverity: 3 - Normal
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 10 Mar 2008 07:24:39 PM UTC, comment #4:

No complaints, so I'll close. SWF 5 is also 'fixed' now.

Benjamin Wolsey <bwy>
Project Member
Tue 05 Feb 2008 03:46:50 PM UTC, comment #3:

This should be fixed for versions 6 and above. Versions 4 and 5 now handle unicode correctly when they aren't supposed to. I'll see how best to 'break' handling for those versions later. It seems better to support SWF6-8, where multibyte characters are more likely to be found anyway.

Benjamin Wolsey <bwy>
Project Member
Fri 26 Oct 2007 09:15:48 PM UTC, comment #2:

I'm not a wide char expert at all, we should check how large the scope of wide chars should be. Also, we should check which SWF version are supposed to allow or not wide chars.

Sandro Santilli <strk>
Project Member
Fri 26 Oct 2007 01:45:57 PM UTC, comment #1:

Is there an easier way of fixing it than changing internal handling of string as_objects to wstring? Evidently, storing wide characters in a std::string is causing problems.

The other way would be to convert the incorrect internal std::string to a correct one whenever it's needed, but that seems less than ideal. As udog shows, length is incorrectly reported, charAt anyway, and looking through the other string methods, at least index_of, index_of sub_string, char_code_at ... well, all of them are going to be wrong with characters above 128.

Or have I missed something?

Benjamin Wolsey <bwy>
Project Member
Tue 23 Oct 2007 01:44:45 PM UTC, original submission:

charAt() returns wrong values for special chars in strings. Looks like it returns the UTF-8 codes instead of the single char value.

--- code in attached test case ---

// Special chars (UTF8?) test

function dump(s) {
var out = "LEN="+s.length+", CODES=";
for (var i=0; i<s.length; i++)
out += "<"+ord(s.charAt(i))+">";
return out;
}

var s = "höm";
trace("plain: "+s);
trace("string: "+dump(s));
trace("correct: LEN=3, CODES=<104><246><109>");

trace("");

var s = "áà";
trace("plain: "+s);
trace("string: "+dump(s));
trace("correct: LEN=2, CODES=<225><224>");

------------------------------------------

Current HEAD prints this output:

2973] 15:41:35: TRACE: plain: höm
2973] 15:41:35: TRACE: string: LEN=4, CODES=<104><-61><-74><109>
2973] 15:41:35: TRACE: correct: LEN=3, CODES=<104><246><109>
2973] 15:41:35: TRACE:
2973] 15:41:35: TRACE: plain: áà
2973] 15:41:35: TRACE: string: LEN=4, CODES=<-61><-95><-61><-96>
2973] 15:41:35: TRACE: correct: LEN=2, CODES=<225><224>
2973] 15:41:35: DEBUG: Global instance list grew to 1 entries

The "correct" lines show what the proprietary player would return.

Udo Giacomozzi <udog>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #14186:  special_codes.swf added by udog (314B - application/x-shockwave-flash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by bwy (Posted a comment)
  • -unavailable- added by udog (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 10 Mar 2008 07:24:39 PM UTCbwyStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 05 Feb 2008 03:46:50 PM UTCbwyStatusNone=>Ready For Test
    Tue 23 Oct 2007 01:44:45 PM UTCudogAttached File-=>Added special_codes.swf, #14186

    Back to the top


    Powered by Savane 3.1-cleanup1