bugGnash - The GNU Flash player - Bugs: bug #24139, Failures in String case conversion...

 
 

bug #24139: Failures in String case conversion for non-utf-8 locales.

Submitted by:  Benjamin Wolsey <bwy>
Submitted on:  Tue 26 Aug 2008 06:36:38 AM UTC  
 
Category: NoneSeverity: 4 - Important
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: Benjamin Wolsey <bwy>
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 06 Oct 2008 07:04:44 PM UTC, comment #5:

The tip on how to fix is "Your locale probably can't convert non-ascii characters to lower case. Using a UTF8 locale may fix this".

I expect this mode of converting case to be gone after the release.

Benjamin Wolsey <bwy>
Project MemberIn charge of this item.
Mon 06 Oct 2008 06:55:25 PM UTC, comment #4:

We get the ERROR now, but no tip on how to fix.
How to fix seems to be running 'locale -a' (POSIX) to find the list of supported locales, then pick one that contains the 'utf8' or 'utf-8' (case-insensitive) label and assign to the LANG environment variable.

Could work as an heuristic for 'make check'.
Of course if NO utf-8 locale is installed we'll still fail...

Sandro Santilli <strk>
Project Member
Thu 25 Sep 2008 10:31:12 AM UTC, comment #3:

This is a blocker for me, unless gnash is able to let the user know about the failure and how to fix.

+1 for ICU,glib or pango.

btw, you mention that we'd get an exception thrown
if a local can't be constructed (original submission option a).
Can we get an ERROR printed when that happens ?

Sandro Santilli <strk>
Project Member
Fri 19 Sep 2008 04:28:04 PM UTC, comment #2:

I guess getting filures on 'make check' is good behaviour
for this case. Best if use also gets an ERROR message when
locales required to play a movie aren't found.

Sandro Santilli <strk>
Project Member
Fri 19 Sep 2008 04:21:29 PM UTC, comment #1:

This should no longer abort on an invalid locale, but the failures for non-utf8 locales aren't fixed.

I'm downgrading from a blocker because it no longer aborts (but if anyone thinks it's serious enough, put it back up).

I think it's better that it passes for most people than none, but it isn't consistent.

Benjamin Wolsey <bwy>
Project MemberIn charge of this item.
Tue 26 Aug 2008 06:36:38 AM UTC, original submission:

Actionscript has two case conversion methods: the old and deprecated global toUpper / toLower methods, which cannot deal with UTF-8 and the String.toUpperCase / String.toLowerCase.

The String methods can convert any of the 65535 unicode characters supported in Flash to upper or lower case (when such a thing exists in the character set).

The first method is easy to implement by using toupper with the standard POSIX locale.

The second method can be implemented using any UTF-8 locale on GNU/Linux. The following test shows a small difference in the number of characters seen to have a lower and upper case, but the discrepancy is probably not a problem:

c = 0;
for (i = 128; i < 10000; ++i) {
f = chr(i);
if (f != f.toUpperCase()) {
trace (i + ": " + f + "-" + f.toUpperCase());
c++;
}
}
trace (c);

However, we can't rely on a valid UTF-8 locale being available. Older distros, particularly in the US, use the POSIX locale and have no utf-8 locale installed, so the tests fail. Worse, Gnash will abort if a locale is specified (LC_ALL=UTF-8, for instance) that it can't find.

So a portable solution is needed: either (a) make sure a suitable locale is installed, (b) use an external library, or (c) write our own code.

(a) is difficult to do portably, especially to get it to work reliably with compiled code. As the locale object is constructed at runtime, it will throw an exception if it's not found. Locale names are implementation-dependent.
(b) ICU might be a candidate. Glib / pango can also do it, I think.
(c) would be ugly and difficult.

I'm fairly sure the pp doesn't use system locales for its case conversion.

Benjamin Wolsey <bwy>
Project MemberIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

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 (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 10 Dec 2010 06:32:55 AM UTCbwyStatusNone=>Fixed
      Assigned toNone=>bwy
      Open/ClosedOpen=>Closed
    Fri 10 Oct 2008 05:35:59 PM UTCstrkSeverity5 - Blocker=>4 - Important
    Thu 25 Sep 2008 10:31:11 AM UTCstrkSeverity4 - Important=>5 - Blocker
    Fri 19 Sep 2008 04:21:28 PM UTCbwySeverity5 - Blocker=>4 - Important

    Back to the top


    Powered by Savane 3.1-cleanup1