Bug 657266

Summary: Finnish locale includes unnecessary, confusing trailing spaces in the abbreviated months
Product: Red Hat Enterprise Linux 5 Reporter: Göran Uddeborg <goeran>
Component: glibcAssignee: Jeff Law <law>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: fweimer, iannis, law, mfranc, mnewsome, pfrankli, pmuller, pruzicka
Target Milestone: rc   
Target Release: 5.7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Same as RHEL 6.3 BZ 657572
Story Points: ---
Clone Of:
: 657570 657572 (view as bug list) Environment:
Last Closed: 2013-01-08 03:44:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 657570, 657572, 743405    
Attachments:
Description Flags
Program to use as a test case
none
Remove trailing whitespaces from abmon fi_FI locale.
none
Remove trailing whitespaces from abmon fi_FI locale: RHEL5 patch, for all the months none

Description Göran Uddeborg 2010-11-25 10:53:56 UTC
Description of problem:
When using the modifier %b in an strptime() pattern, and when using the Finnish locale, (fi_FI or fi_FI.utf8) it fails to recognize all short names except maalis (March).  It also fails to recognize the long name marraskuu (November).

Version-Release number of selected component (if applicable):
glibc-2.5-49.el5_5.7

How reproducible:
Every time

Steps to Reproduce:
1. Compile the attached test program: cc ca.c -o ca
2. Run it with one or more of the failing months, for example:
   ./ca 1985.tammi.18 1985.helmi.18 1985.marraskuu.18
  
Actual results:
These are reported as failures.

Expected results:
They should be coorectly converted to dates.

Additional info:
I compared with RHEL6 too.  In that case, both the short and long version of November (marras and marraskuu) works correctly, but the rest still fails.

Comment 2 Göran Uddeborg 2010-11-25 12:04:34 UTC
Created attachment 462878 [details]
Program to use as a test case

Comment 3 Adrien Kunysz 2010-11-25 14:12:49 UTC
Created attachment 462905 [details]
Remove trailing whitespaces from abmon fi_FI locale.

$ for i in `seq 1 12` ; do LANG=fi_FI.utf8 date -d `printf 2010%02d01 $i` +%b ; done | tee months.fi_FI.utf8
tammi 
helmi 
maalis
huhti 
touko 
kesä  
heinä 
elo   
syys  
loka  
marras
joulu 
$ for i in `seq 1 12` ; do LANG=fi_FI date -d `printf 2010%02d01 $i` +%b ; done > months.fi_FI
$ while read M ; do LANG=fi_FI.utf8 ./ca 2010.$M.18 ; done < months.fi_FI.utf8 
2010.tammi .18 -> 2010-1-18
2010.helmi .18 -> 2010-2-18
2010.maalis.18 -> 2010-3-18
2010.huhti .18 -> 2010-4-18
2010.touko .18 -> 2010-5-18
2010.kesä  .18 -> 2010-6-18
2010.heinä .18 -> 2010-7-18
2010.elo   .18 -> 2010-8-18
2010.syys  .18 -> 2010-9-18
2010.loka  .18 -> 2010-10-18
2010.marras.18 FAILED (2010-3-0)
2010.joulu .18 -> 2010-12-18
$ while read M ; do LANG=fi_FI ./ca 2010.$M.18 ; done < months.fi_FI
2010.tammi�.18 -> 2010-1-18
2010.helmi�.18 -> 2010-2-18
2010.maalis.18 -> 2010-3-18
2010.huhti�.18 -> 2010-4-18
2010.touko�.18 -> 2010-5-18
2010.kes䠠.18 -> 2010-6-18
2010.hein��.18 -> 2010-7-18
2010.elo���.18 -> 2010-8-18
2010.syys��.18 -> 2010-9-18
2010.loka��.18 -> 2010-10-18
2010.marras.18 FAILED (2010-3-0)
2010.joulu�.18 -> 2010-12-18

I see two problems:
- there are white spaces at the end of all the Finnish short months names except for November;
- strptime(3) doesn't behave consistently with date(1) wrt short name for November in Finnish.

This first problem seems to be caused by seemingly superfluous <U00A0> characters at the end of most abbreviated months in localedata/locale/fi_FI:

171	abmon    "<U0074><U0061><U006D><U006D><U0069><U00A0>";/
172	         "<U0068><U0065><U006C><U006D><U0069><U00A0>";/
173	         "<U006D><U0061><U0061><U006C><U0069><U0073>";/
174	         "<U0068><U0075><U0068><U0074><U0069><U00A0>";/
175	         "<U0074><U006F><U0075><U006B><U006F><U00A0>";/
176	         "<U006B><U0065><U0073><U00E4><U00A0><U00A0>";/
177	         "<U0068><U0065><U0069><U006E><U00E4><U00A0>";/
178	         "<U0065><U006C><U006F><U00A0><U00A0><U00A0>";/
179	         "<U0073><U0079><U0079><U0073><U00A0><U00A0>";/
180	         "<U006C><U006F><U006B><U0061><U00A0><U00A0>";/
181	         "<U006D><U0061><U0072><U0072><U0061><U0073>";/
182	         "<U006A><U006F><U0075><U006C><U0075><U00A0>"

http://sourceware.org/git/?p=glibc.git;a=blame;f=localedata/locales/fi_FI

As far as I can tell this problem has been present from the first git import. The attached patch fixes this issue.

I am not sure about the second problem yet, will open a separate bug if appropriate.

Comment 4 Adrien Kunysz 2010-11-26 12:50:11 UTC
Created attachment 463075 [details]
Remove trailing whitespaces from abmon fi_FI locale: RHEL5 patch, for all the months

The previous patch was missing a few things and was against git glibc. This one is for RHEL5. Test case without the patch:

$ for i in `seq 1 12` ; do LANG=fi_FI.utf8 date -d `printf 2010%02d01 $i` +.%b. ; done
.tammi .
.helmi .
.maalis.
.huhti .
.touko .
.kesä  .
.heinä .
.elo   .
.syys  .
.loka  .
.marras.
.joulu .

With the patch:

$ for i in `seq 1 12` ; do LANG=fi_FI.utf8 date -d `printf 2010%02d01 $i` +.%b. ; done
.tammi.
.helmi.
.maalis.
.huhti.
.touko.
.kesä.
.heinä.
.elo.
.syys.
.loka.
.marras.
.joulu.

Comment 6 RHEL Program Management 2011-06-20 22:17:44 UTC
This request was evaluated by Red Hat Product Management for inclusion in Red Hat Enterprise Linux 5.7 and Red Hat does not plan to fix this issue the currently developed update.

Contact your manager or support representative in case you need to escalate this bug.

Comment 9 Andreas Schwab 2011-11-02 16:17:46 UTC
Where is this defined?

Comment 11 Göran Uddeborg 2011-11-14 20:48:36 UTC
You mean where the abbreviated month names are defined?  They are in the "abmon" section of the file /usr/share/i18n/locales/fi_FI.  (According to comment 3 it is in localedata/locale/fi_FI, which I guess is the place in the source.  I haven't checked that.)

Comment 15 RHEL Program Management 2012-04-02 13:07:59 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 18 Patsy Griffin 2012-06-12 02:21:55 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Same as RHEL 6.3 BZ 657572

Comment 20 errata-xmlrpc 2013-01-08 03:44:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0022.html