Bug 36038 - Support extended LCID format in number format code
Summary: Support extended LCID format in number format code
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Laurent BP
QA Contact:
URL:
Whiteboard: numberformat target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 13:46 UTC by Kohei Yoshida
Modified: 2017-01-15 17:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file to describe long LCID for numerals and calendars (23.42 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-08-29 20:19 UTC, Laurent BP
Details
Test file for numerals and calendars in LibO (32.13 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-08-29 20:20 UTC, Laurent BP
Details
XL test file containing numerals and calendars (24.54 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-09-03 16:00 UTC, Laurent BP
Details
Test file for numerals and calendars in Excel (45.91 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-09-11 09:18 UTC, Laurent BP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kohei Yoshida 2011-04-06 13:46:48 UTC
This is a spin-off of Bug 33089.

We need to support Microsoft-style LCID (from here on out referred to as the extended LCID).  Here is the reference:
http://office.microsoft.com/en-us/excel-help/creating-international-number-formats-HA001034635.aspx#BMcalendartype
Comment 1 QA Administrators 2015-02-19 15:45:46 UTC Comment hidden (obsolete)
Comment 2 QA Administrators 2016-02-21 08:37:43 UTC Comment hidden (obsolete)
Comment 3 Laurent BP 2016-08-29 20:17:04 UTC
Long LCID used by Excel are formed as seven hexadecimal digits:
[$~NCCLLLL]
where:
- N stands for the numeral alphabet used:
N	Representation	Numeral	Main LCID	Other LCID
0	1234567890			
1	1234567890	arab-Europ		
2	١٢٣٤٥٦٧٨٩٠	arab-indi	401	1401, 3c01, 0c01, 801, 2c01, 3401, 3001, 1001, 1801, 2001, 4001, 2801, 1c01, 3801, 2401
3	۱۲۳۴۵۶۷۸۹۰	arab-farsi	429	
4	१२३४५६७८९०	hindi-devanagari	439	44E, 461, 861
5	১২৩৪৫৬৭৮৯০	bengali	445	845
6	੧੨੩੪੫੬੭੮੯੦	punjabi	446	
7	૧૨૩૪૫૬૭૮૯૦	gujarati	447	
8	୧୨୩୪୫୬୭୮୯୦	oriya	448	
9	௧௨௩௪௫௬௭௮௯0	tamil	449	849
A	౧౨౩౪౫౬౭౮౯౦	telugu	44A	
B	೧೨೩೪೫೬೭೮೯೦	kannada	44B	
C	൧൨൩൪൫൬൭൮൯൦	malayalam	44C	
D	๑๒๓๔๕๖๗๘๙๐	thai	44E	
E	໑໒໓໔໕໖໗໘໙໐	lao	454	
F	༡༢༣༤༥༦༧༨༩༠	tibetan	851	


- CC defines a calendar. I detected 8 different calendars:
    - 00 (or any unknown code): Gregorian
    - 03: Gengou
    - 05: ??? 29th August 2016 in Gregorian calendar is 29/08/4349 in this calendar
    - 06 and 17: hijri
    - 07: Buddhist
    - 08: Hebrew
    - 10: Indian
    - 0E, 0F, 11, 12, 13: ??? calendar 33 days before (29th August 2016 in Gregorian calendar is 27/07/2016 in these calendars)
    + all these calendars have a second valid value with +80 (i.e. 83, 85, 86, and so on). No idea what these values are for.

- LLLL is the short Microsoft LCID

So in Excel you can combine any calendar with any LCID, whereas in LibreOffice each calendar is only valid for some LCID:
- Buddhist: 454 (Lao), 41E (Thai)
- Gengou: 411 (Japan)
- Hanja or hanja_yoil: should be 412 (Korean)
- Hebrew: should be 40D (Hebrew) but does not work
- Hijri: all l10n using Arab alphabet, except 2001 (Oman, may be a bug): 401 (Arabic - Saudi Arabia), 1401 (Arabic - Algeria), 3c01 (Arabic - Bahrain), 0c01 (Arabic - Egypt), 801 (Arabic - Iraq), 2c01 (Arabic - Jordan), 3401 (Arabic - Kuwait), 3001 (Arabic - Lebanon), 1001 (Arabic - Libya), 1801 (Arabic - Morocco), 4001 (Arabic - Qatar), 2801 (Arabic - Syria), 1c01 (Arabic - Tunisia), 3801 (Arabic - U.A.E.), 2401 (Arabic - Yemen) and 429 (Farsi)
- ROC: 404 (Chinese Taiwan)
Comment 4 Laurent BP 2016-08-29 20:19:53 UTC
Created attachment 127069 [details]
Test file to describe long LCID for numerals and calendars
Comment 5 Laurent BP 2016-08-29 20:20:41 UTC
Created attachment 127070 [details]
Test file for numerals and calendars in LibO
Comment 6 Laurent BP 2016-09-03 16:00:16 UTC
Created attachment 127136 [details]
XL test file containing numerals and calendars

(In reply to Laurent BP from comment #3)
> D	๑๒๓๔๕๖๗๘๙๐	thai	44E	

Oups, I mean 41E for Thai of course
> D	๑๒๓๔๕๖๗๘๙๐	thai	41E
Comment 8 Xisco Faulí 2016-09-10 22:35:22 UTC
Hi Laurent,
Please, next time you assign a bug to yourself, remember to change the status and the assignee.
Regards
Comment 9 Laurent BP 2016-09-11 09:18:45 UTC
Created attachment 127253 [details]
Test file for numerals and calendars in Excel

(In reply to Laurent BP from comment #3)
> Long LCID used by Excel are formed as seven hexadecimal digits:
> [$~NCCLLLL]
Actually I was a little bit lazy: there are two hexa digits for numerals. Updated information: Extended LCID code looks like
[$~NNCCLLLL]
where:
- NN stands for the numeral alphabet used:
NN	Representation	Numeral	Main LCID	Other LCID
00	1234567890			
01	1234567890	arabic-Europ		
02	١٢٣٤٥٦٧٨٩٠	arabic-indi	401	1401, 3c01, 0c01, 801, 2c01, 3401, 3001, 1001, 1801, 2001, 4001, 2801, 1c01, 3801, 2401
03	۱۲۳۴۵۶۷۸۹۰	arabic-farsi	429	
04	१२३४५६७८९०	hindi-devanagari	439	44E, 461, 861
05	১২৩৪৫৬৭৮৯০	bengali	445	845
06	੧੨੩੪੫੬੭੮੯੦	punjabi	446	
07	૧૨૩૪૫૬૭૮૯૦	gujarati	447	
08	୧୨୩୪୫୬୭୮୯୦	oriya	448	
09	௧௨௩௪௫௬௭௮௯0	tamil	449	849
0A	౧౨౩౪౫౬౭౮౯౦	telugu	44A	
0B	೧೨೩೪೫೬೭೮೯೦	kannada	44B	
0C	൧൨൩൪൫൬൭൮൯൦	malayalam	44C	
0D	๑๒๓๔๕๖๗๘๙๐	thai	41E	
0E	໑໒໓໔໕໖໗໘໙໐	lao	454	
0F	༡༢༣༤༥༦༧༨༩༠	tibetan	851	
10	၁၂၃၄၅၆၇၈၉၀	burmese (myanmar)	455	
11	፩፪፫፬፭፮፯፰፱0	tigrina ethiopia	473	873
12	១២៣៤៥៦៧៨៩០	khmer	453	
13	᠑᠒᠓᠔᠕᠖᠗᠘᠙᠐	mongolian	C50	850, 7C50
1B	一二三四五六七八九〇	japanese	411	
1C	壱弐参四伍六七八九〇	japanese	411	
1D	1234567890	japanese	411	
1E	一二三四五六七八九○	chinese - simplified	804	1004, 7804
1F	壹贰叁肆伍陆柒捌玖零	chinese - simplified	804	
20	1234567890	chinese - simplified	804	
21	一二三四五六七八九○	chinese - traditionnal	404	c04, 1404
22	壹貳參肆伍陸柒捌玖零	chinese - traditionnal	404	
23	1234567890	chinese - traditionnal	404	
24	一二三四五六七八九0	korean	412	812
25	壹貳參四伍六七八九零	korean	412	
26	1234567890	korean	412	
27	일이삼사오육칠팔구영	korean - hangul	412	

- CC defines a calendar. I detected 8 different calendars:
    - 00 (or any unknown code): Gregorian
    - 03: Gengou
    - 05: ??? 29th August 2016 in Gregorian calendar is 29/08/4349 in this calendar
    - 06 and 17: hijri
    - 07: Buddhist
    - 08: Hebrew
    - 10: Indian
    - 0E, 0F, 11, 12, 13: ??? calendar 33 days before (29th August 2016 in Gregorian calendar is 27/07/2016 in these calendars)

- LLLL is the short Microsoft LCID

So in Excel you can combine any calendar with any LCID, whereas in LibreOffice each calendar is only valid for some LCID:
- Buddhist: 454 (Lao), 41E (Thai)
- Gengou: 411 (Japan)
- Hanja or hanja_yoil: should be 412 (Korean)
- Hebrew: should be 40D (Hebrew) but does not work
- Hijri: all l10n using Arab alphabet: 401 (Arabic - Saudi Arabia), 1401 (Arabic - Algeria), 3c01 (Arabic - Bahrain), 0c01 (Arabic - Egypt), 801 (Arabic - Iraq), 2c01 (Arabic - Jordan), 3401 (Arabic - Kuwait), 3001 (Arabic - Lebanon), 1001 (Arabic - Libya), 1801 (Arabic - Morocco), 2001 (Arabic - Oman), 4001 (Arabic - Qatar), 2801 (Arabic - Syria), 1c01 (Arabic - Tunisia), 3801 (Arabic - U.A.E.), 2401 (Arabic - Yemen) and 429 (Farsi)
- ROC: 404 (Chinese Taiwan)
Comment 10 Commit Notification 2016-10-10 21:21:57 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e991b421905e78f020d6ece280dd17bfce4e31e0

tdf#36038 Export to Excel extended LCID

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2016-10-10 21:24:06 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=aa4e560822787d62de0bcca52036242ce1160b45

tdf#36038 Import extended LCID from Excel

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2016-11-11 12:34:30 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8d811eda74a6b2b249a44a9217328e8d2788ec3c

tdf#36038 QA test export/import extended LCID to Excel

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2016-11-23 06:42:30 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/help/commit/?id=576f344764a89a1533d39d1424d3bd4176af1aae

tdf#36038 Help for Extended LCID
Comment 14 Xisco Faulí 2017-01-13 12:33:53 UTC
Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?