Issue 41672 - Numbers inappropriately formatted using Thai digits
Summary: Numbers inappropriately formatted using Thai digits
Alias: None
Product: Internationalization
Classification: Code
Component: code (show other issues)
Version: 680m74
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: ulf.stroehler
QA Contact: issues@l10n
Depends on:
Blocks: 41707
  Show dependency tree
Reported: 2005-01-31 06:41 UTC by samphan
Modified: 2013-08-07 15:00 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Quick & dirty patch that able to fix this bug in all places for all locale (2.97 KB, patch)
2005-02-01 14:36 UTC, samphan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description samphan 2005-01-31 06:41:16 UTC
When OS locale is set to Thai, numbers in various places will be displayed using
Thai digits. This has been tested on Windows and Linux. I also found the same
problem with other locales that have non-ASCII digits, such as Hindi and Arabic. 
It happens no matter what locale is set in 'Tools/Options/Language
Settings/Languages/Locale setting', even when 'Language Setting/Complex Text
Layout/Numerals' is set to Arabic, and even when 'Language
Setting/Languages/Enabled for complex text layout' is disabled.

Test cases :-
	a) Set the OS locale using 'Control Panel/Regional and Language
Options/Standards and formats'. Set it to Thai. 
	b) Run OOo (quickstarter may interfere with this so close it beforehand).
	a) Set the LANG environment to Thai. Use the command-line shell, type 'export
	b) Run 'soffice' from the same shell.

The problem will show up in :-

- Writer
a) On formatting toolbar, change the font size to any different number, then
it'll be displayed using Thai digits. Change the style to any style name with
number (e.g. Heading 1), then the number will be displayed using Thai digits
(Heading เน‘). This is not what Thai expect. Thai rarely use Thai digits now.
They're used only in some formal text. So having Thai digits in the UI looks
b) Type some numbers in the document (e.g. 123) then export to PDF. All (ASCII)
numbers in the result pdf file will be printed using Thai digits.

- Impress
c) The numbers in the color drop-down list (e.g. Blue 7) on the line & fill
toolbar are displayed using Thai digits. This happens in Draw too.
d) Type some numbers in the presentation. They'll be displayed using Thai digits
(but print correctly)

- Calc
e) Type some numbers in the data entry line, all numbers in the line will be
displayed first using Thai digits then, after a quick refresh, using ASCII digits.

I don't think I've covered all bugs related to this problem. All are the same,
some numbers are displayed using Thai digits if the OS locale is set to Thai.
Switch the OS locale back to, says English (US) or en_US and the problems gone.

OOo has this problem since 1.1 (when it implemented the native numeral feature).
In the older versions, it also shows this behavior when print too (all ASCII
numbers printed using Thai digits, see issue 22181). But this is fixed because I
don't see it again even in Impress which display numbers using Thai digits on
screen but not in print.
Comment 1 falko.tesch 2005-02-01 07:35:09 UTC
FT: Karl, IIRC this wasn't really specified. So are there any internal hints how
we handle Thai digits? If not I'd be happy to provide a short specification in
this matter.
Comment 2 samphan 2005-02-01 14:36:30 UTC
Created attachment 22093 [details]
Quick & dirty patch that able to fix this bug in all places for all locale
Comment 3 samphan 2005-02-01 14:54:10 UTC
To help you find the location and cause of this bug, I've attached a quick &
dirty patch that able to fix this bug in all occurences in one place. Apply the
patch and all problems I've described here will gone.

The bug came from the fact that OutputDevice::SetDigitLanguage() sometimes use
system language instead of using the one specified in the CTL setting dialog box.
The patch is (too) simple, sending the setting from 'Tools/Language
Settings/CTL/Numeral' dialog to vcl thru a static variable.

This is a quick & dirty fix anyway, just to help you understand the problem.
Comment 4 karl.hong 2005-02-01 20:24:43 UTC
Karl->FT: No, I don't have internal hints for this. It is in application layer
to define how it should behaviour. 

I check Hebrew MS Office, it does not show native digital in UI.
Comment 5 falko.tesch 2005-02-02 11:54:24 UTC
FT: For 2.0 we should fix this issue. Please check your code if there are any
hints why Thai numerals are sometimes shown in Arabic and sometimes in Thai.
If you find the reason please fix it the way that Thai numerela are never and
nowhere shown in the UI (regardless of the Arabic-Hindi setting). Thx a lot.
Comment 6 Oliver Specht 2005-02-02 12:13:12 UTC
->hdu: Looks like a VCL issue. 
Comment 7 2005-02-03 16:26:14 UTC
Setting the digit language to the system language should not suffice to trigger
digit substitution. The digit language has to be explcitly set. Fixed in CWS vcl36.
Comment 8 samphan 2005-02-05 07:02:58 UTC
I apply the patch from
to my copy of OOo 680_m69 build. It really solves all the bugs I report here.

However, there's a new bug. When the Numeral setting is set to Hindi -
in Calc, the numbers in the cells will be in Hindi (which is right) but, 
in impress, there's a strange behavior.

1) set Tool/Options/Language Setting/CTL/Numberals to Hindi
2) run Impress
3) type some numbers in a presentation, it'll be in Arabic
4) deselect the frame
5) select the frame again (by clicking on it), the numbers will be in Hindi
6) type something in the frame, the numbers will be in Arabic again.

That is, the numbers in the frame will be in Hindi when it's first selected
and become Arabic when you type something.
The problem occurs when the Numeral setting is set to Hindi only.
When it is set to Arabic, the numbers are always in Arabic.
When it is set to System, the numbers are always in Arabic too,
no matter how the OS locale or Language Setting/Locale Setting is set.

That is, if the Numeral setting is set to System and the OS locale
is set to Thai, the numbers (e.g. in Calc cells) will still be in Arabic.
Comment 9 2005-02-16 13:53:28 UTC
Comment 10 2005-02-16 13:54:54 UTC
Comment 11 2005-02-16 13:56:00 UTC
Comment 12 ulf.stroehler 2005-03-15 19:56:08 UTC
@samphan: thanks for the detailed description.
Indeed the current fix triggers the described strange behaviour in impress.
Would you mind to file a follow-up for this and provide a reference to this
issue in it? Thanks a lot.

Verified in cws 'vcl36'.
Comment 13 ulf.stroehler 2005-04-01 17:50:28 UTC
Verified in master m90 Build:8893 (internal build only sofar).