Skip to content

[uom] Add Celsius, Fahrenheit and other UoM single glyph aliases#5640

Merged
mherwege merged 6 commits into
openhab:mainfrom
andrewfg:celsius
Jun 14, 2026
Merged

[uom] Add Celsius, Fahrenheit and other UoM single glyph aliases#5640
mherwege merged 6 commits into
openhab:mainfrom
andrewfg:celsius

Conversation

@andrewfg

@andrewfg andrewfg commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

There is confusion between the two character symbol adopted by OH for Celsius °C (which is the official standard) and the one character symbol ℃ (which is a compatibility glyph for East Asian languages). This PR hopes to fix it. But I would like OH maintainers to please give feedback over the proposed solutions. And there is the same issue for Fahrenheit, and some other units..

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch


What the AI says about temperature symbols

The internationally accepted SI symbol is unequivocally “°C”.
The single-character symbol “℃” is not an SI‑approved symbol — it is a Unicode compatibility glyph used mainly in East Asian typography.

📌 What the standards say

Why “℃” is not the standard

  • (Unicode U+2103) is a compatibility symbol included for legacy East Asian typesetting.
  • It is not recognised by SI, not used in scientific publications, and not recommended for technical writing, standards, or instrumentation.

Bottom line

  • Correct SI symbol: °C
  • Avoid: (non‑standard, typographic convenience only)

If you want, I can also tell you which environments or fonts render “℃” poorly and why it’s avoided in engineering contexts.

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg

andrewfg commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Ping @htreu

@andrewfg andrewfg changed the title [uom] Fix Celsius symbol(s) [uom] Fix Celsius (and Fahrenheit) symbol(s) Jun 9, 2026
…as aliase

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg changed the title [uom] Fix Celsius (and Fahrenheit) symbol(s) [uom] Fix Celsius and Fahrenheit symbols Jun 9, 2026
@andrewfg andrewfg marked this pull request as ready for review June 9, 2026 16:23
@andrewfg andrewfg changed the title [uom] Fix Celsius and Fahrenheit symbols [uom] Add Celsius and Fahrenheit UoM symbol aliases Jun 9, 2026
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg

This comment was marked as outdated.

@dilyanpalauzov

Copy link
Copy Markdown
Contributor

bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/Script.xtext contains:

COMMON_UNIT_SYMBOLS:
    '°C' | '°F' | 'Ω' | '℃' | '°' | '%' | 'm²' | 'm³'

It does not contain .

Nobody has asked for , so probably it is also not necessary.

@andrewfg

andrewfg commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

@dilyanpalauzov thanks for the feedback but excuse me for asking again to be clear .. which characters do you think shall be, and shall not be, added to this PR? From your prior post maybe you are suggesting to add at least the Ω symbol ?? .. but you are suggesting that none of the East Asian single character glyphs for Roman multi character symbols ㎏ ㎡ ㎥ ㎜ ㎝ ㎞ ㏈ shall be included. Or??

EDIT: I think Ω is already inherited from the Indriya library..

@dilyanpalauzov

Copy link
Copy Markdown
Contributor

I am drawing the attention that Script.xtext also has handling of special characters, used as units. I am not suggesting anything.

@andrewfg

Copy link
Copy Markdown
Contributor Author

Script.xtext also has handling of special characters

Do you know what is the purpose of Script.xtext?

@mherwege

Copy link
Copy Markdown
Contributor

Script.xtext also has handling of special characters

Do you know what is the purpose of Script.xtext?

Parsing DSL scripts, rule bodies and DSL transformations.

andrewfg added 2 commits June 14, 2026 15:10
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg changed the title [uom] Add Celsius and Fahrenheit UoM symbol aliases [uom] Add Celsius, Fahrenheit and other UoM single glyph aliases Jun 14, 2026

@mherwege mherwege left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mherwege mherwege merged commit 053fcdc into openhab:main Jun 14, 2026
5 checks passed
@mherwege mherwege added this to the 5.2 milestone Jun 14, 2026
@mherwege mherwege added the enhancement An enhancement or new feature of the Core label Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature of the Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants