bugGNU Typist - Bugs: bug #33957, Russian gettext l10n causes...

 
 

bug #33957: Russian gettext l10n causes "invalid value for msgid" error

Submitted by:  Tim Marston <edam>
Submitted on:  Fri 05 Aug 2011 04:13:53 PM UTC  
 
Severity: 3 - NormalPriority: 5 - Normal
Status: InvalidPrivacy: Public
Assigned to: Tim Marston <edam>Open/Closed: Closed
Operating System: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 19 Sep 2011 10:31:48 PM UTC, comment #2:

Just to follow up... UTF-8 will be supported in version 2.9.

Tim Marston <edam>
Project AdministratorIn charge of this item.
Mon 08 Aug 2011 08:10:15 PM UTC, comment #1:

This is not a bug afterall.

Turns out gettext is returning strings in the encoding requested via LANG. So, with LANG=ru_RU.koi8r, gtypist works as expected. With LANG=ru_RU.utf8, gettext returns UTF-8 encoded strings, which gtypist chokes on, as it doesn't support UTF-8 yet.

Tim Marston <edam>
Project AdministratorIn charge of this item.
Fri 05 Aug 2011 04:13:53 PM UTC, original submission:

Code in gtypist.c (at line 2011 as of gtypist 2.8.5) performs the following check on a gettext-returned string which, in English, is "Y/N" and is used to determine valid entered characters at a yes/no prompt:

if (strlen(YN) != 3 || YN[1] != '/' || !isupper(YN[0]) || !isupper(YN[2]))
{
fprintf( stderr,
"%s: i18n problem: invalid value for msgid \"Y/N\": %s\n",
argv0, YN );
exit( 1 );
}

When LANGUAGE=ru, the returned string fails the test, resulting in the error message.

I've looked in the .mo file (created during install from the .gmo file created at build time) and confirmed with strace that that file is being used and the string returned is the following byte sequence: 0xe4, '/', 0xee, 0. So, perhaps isupper() is returning false?

This only affects the 2.8 branch. As of gtypist 2.9, gettext will be returning UTF-8 strings, so this issue will be irrelevant.

Tim Marston <edam>
Project AdministratorIn 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 edam (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 08 Aug 2011 08:10:15 PM UTCedamStatusConfirmed=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1