Bug 161288 - Wrong Chinese upper number negative sign
Summary: Wrong Chinese upper number negative sign
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Po-Yen Huang
URL:
Whiteboard: target:24.8.0 target:24.2.5
Keywords:
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2024-05-27 06:52 UTC by Po-Yen Huang
Modified: 2024-06-01 16:09 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Shows config for Cell format dialog (66.91 KB, image/png)
2024-05-27 06:58 UTC, Po-Yen Huang
Details
Shows result in cell (6.07 KB, image/png)
2024-05-27 06:59 UTC, Po-Yen Huang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Po-Yen Huang 2024-05-27 06:52:00 UTC
Description:
It should show 負 instead of 偩 in Number Format [NatNum5] for negative sign.

Steps to Reproduce:
1. Type negative number in a cell
2. Right click and choose set cell format
3. Type [NatNum5]0 in format code field at Number tab
4. Click OK to apply format code

Actual Results:
Shows 偩壹仟伍佰 in cell

Expected Results:
Shows 負壹仟伍佰 in cell


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 8; OS: Linux 6.9; UI render: default; VCL: kf6 (cairo+wayland)
Locale: zh-TW (zh_TW.UTF-8); UI: zh-TW
24.2.3-3
Calc: threaded
Comment 1 Po-Yen Huang 2024-05-27 06:58:33 UTC
Created attachment 194369 [details]
Shows config for Cell format dialog
Comment 2 Po-Yen Huang 2024-05-27 06:59:02 UTC
Created attachment 194370 [details]
Shows result in cell
Comment 3 m_a_riosv 2024-05-27 10:59:44 UTC
It is based on numbertext.org

Please test if the same happens in
https://numbertext.github.io/
Comment 4 Stéphane Guillou (stragu) 2024-05-27 15:18:56 UTC
(In reply to m_a_riosv from comment #3)
> It is based on numbertext.org
I think that's only for NatNum12.
Comment 5 Franklin Weng 2024-05-29 09:01:03 UTC
It seems to exist in pretty early version.

Actually [NatNum2], [NatNum5], [NatNum8] which show "minus" in Chinese characters, they all are wrong.

Confirmed.

版本:6.4.4.2
組建 ID:3d775be2011f3886db32dfd395a6a6d1ca2630ff
CPU 執行緒:4; OS:Linux 6.5; UI 算繪:預設; VCL: kf5; 
語言地區:zh-TW (zh_TW.UTF-8); 介面語言:zh-TW
Calc: threaded
Comment 6 Franklin Weng 2024-05-29 09:03:41 UTC
(In reply to m_a_riosv from comment #3)
> It is based on numbertext.org
> 
> Please test if the same happens in
> https://numbertext.github.io/

numbertext.org only has Simplified Chinese, but its characters (in Simplified Chinese form) is correct.

Also the word in Japanese is correct.
Comment 7 Stéphane Guillou (stragu) 2024-05-29 11:18:42 UTC
Kevin, Laurent, thought you might be interested.
Comment 8 Ming Hua 2024-05-29 11:35:15 UTC
Yes, [NatNum5] is handled by LibreOffice's own code, specifically at core/i18npool/source/nativenumber/data/numberchar.h, line 137:

const sal_Unicode MinusChar[] = {
    0x002D, // Half Width (Ascii)
    0xFF0D, // Full Width
    0xFF0D, // Chinese Lower
    0x8D1F, // S. Chinese Upper
    0x5069, // T. Chinese Upper
    ...

Here 0x5069 is "偩", and should be changed to 0x8CA0 for "負".
Comment 9 Laurent Balland 2024-05-30 13:21:38 UTC
(In reply to Ming Hua from comment #8)
> Yes, [NatNum5] is handled by LibreOffice's own code, specifically at
> core/i18npool/source/nativenumber/data/numberchar.h, line 137:
> 
> const sal_Unicode MinusChar[] = {
>     0x002D, // Half Width (Ascii)
>     0xFF0D, // Full Width
>     0xFF0D, // Chinese Lower
>     0x8D1F, // S. Chinese Upper
>     0x5069, // T. Chinese Upper
>     ...
> 
> Here 0x5069 is "偩", and should be changed to 0x8CA0 for "負".

Link: https://opengrok.libreoffice.org/xref/core/i18npool/source/nativenumber/data/numberchar.h#132
Comment 10 Po-Yen Huang 2024-05-31 01:23:00 UTC
I have submitted a patch to gerrit: https://gerrit.libreoffice.org/c/core/+/168089
Comment 11 Commit Notification 2024-06-01 10:44:08 UTC
Jeff Huang committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a3f537e13ee64c5bf3155864035c1591e7099101

tdf#161288 Traditional Chinese minus character is U+8CA0(負), not U+5069(偩)

It will be available in 24.8.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2024-06-01 16:09:06 UTC
Jeff Huang committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/e92d2444d7bbfc8d7bfd1d91f64fe5161395885e

tdf#161288 Traditional Chinese minus character is U+8CA0(負), not U+5069(偩)

It will be available in 24.2.5.

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

Affected users are encouraged to test the fix and report feedback.