CHAR in Calligra Sheets: Turn a Numeric Code into a Character
Create text characters from integer codes, with Qt UTF-16, nonprintable characters and Excel migration cautions.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Calligra Sheets. How formula examples are checked
Version scope: Official Calligra 26.08.2 source (KDE Gear release 2026-10-08); KDE stable KF6 English documentation, accessed 2026-10-11. The source registers CHAR separately; no explicit registered alias for this canonical function in the pinned text module. The function has one required argument and no documented optional defaults. Native execution was not performed.
Quick answer: =CHAR(65) is expected to return A. CHAR accepts one numeric code and converts it into a text character. In Calligra 26.08.2 the implementation constructs a Qt QChar, so its behaviour is not Excel’s legacy operating-system code-page mapping. KDE handbook: CHAR; version-pinned source.
What CHAR does — and when to use it
Use CHAR to insert an ordinary punctuation mark, an alphabetic letter or a known BMP symbol from a numeric identifier when that symbol is hard to type into a worksheet. For example, CHAR(33) represents an exclamation mark; CHAR(32) represents a space. For a full Unicode scalar-value lookup, compare UNICHAR, but do not assume Calligra’s implementation handles every code point above U+FFFF. The source uses a 16-bit Qt character for CHAR and a 16-bit ushort for UNICHAR. If you are converting codes imported from a separate application, establish the original encoding first.
Exact syntax, argument type and defaults
=CHAR(code)
| Argument | Required? | Official type | Purpose | Default |
|---|---|---|---|---|
code |
Yes | Integer | Numeric identifier to turn into one character | None |
The KDE XML function definition specifies one integer parameter and a text result. The release registration registers CHAR as a distinct canonical function, not an alias of UNICHAR. The official example is CHAR(65) → A. One-argument formulas do not need an argument separator; nested multi-argument formulas in the English KDE manual use semicolons. Verify localized entry settings in the installed app.
Reproduce the examples in a blank sheet
Put the numbers 65, 90, 33, 32, 169 and 8364 into A2:A7. Put =CHAR(A2) into B2, then copy the formula through B7.
| Cell or formula | Expected output | Validation classification |
|---|---|---|
=CHAR(65) |
A |
KDE official example; independently mapped to U+0041 |
=CHAR(90) |
Z |
Independent 16-bit Unicode mapping |
=CHAR(33) |
! |
Independent Unicode mapping |
=CHAR(32) |
one space; visually blank | Independent mapping; distinguish from empty text |
=CHAR(169) |
© |
Source-derived expectation for U+00A9 |
=CHAR(8364) |
€ |
Source-derived expectation for U+20AC, not an Excel-code-page promise |
All outputs in this table are expected, not observed in Calligra. The formula itself returns text; apply no special cell number format. A code for a control character may appear visually blank even though a character exists.
Advanced: make readable labels from numeric codes
Imagine A2 stores 65 and B2 stores an order suffix such as 104. In C2 use:
=CONCATENATE(CHAR(A2);"-";B2)
Expected with A2=65 and B2=104: A-104 (CONCATENATE joins text values). To flag invalid negative codes before calling CHAR, use:
=IF(A2<0;"Invalid negative code";CHAR(A2))
This is a partial guard. It does not verify all Unicode scalar validity, control-character display, or Excel transfer behaviour. Test imported codes in the same Calligra installation where the workbook will be used.
Errors, limits and troubleshooting
The pinned implementation converts the input to integer. For a negative converted code it returns an internal numeric error (errorNUM), conventionally displayed as a number-related error; the exact localized on-screen spelling was not tested. For zero, the C++ branch constructs QChar(0) rather than explicitly issuing an error; a null control character is not a useful visible glyph. Do not assert that every invalid or supplementary code is rejected cleanly: QChar has a 16-bit code-unit representation, and the page has not run an actual out-of-range call.
If the displayed character is wrong, check whether the code came from an ANSI/Windows encoding, Unicode, or a legacy file. If the result is a square box, it may be a font/glyph issue rather than formula failure. If a copied workbook uses commas, replace separators according to your localized Calligra formula editor; CHAR itself has only one argument.
Excel, LibreOffice and interchange behaviour
Microsoft documents Excel CHAR as using the computer’s character set with a 1–255 documented input range. That is not the same promise as Qt’s 16-bit character construction in this pinned Calligra source. ASCII examples 32–126 are safer migration tests; check non-ASCII codes individually. Do not claim a separate LibreOffice behavioural match for every code point without native testing. If the workbook is meant to travel across editors, storing the desired literal Unicode character or documenting the encoding can be more portable than relying on a numeric code.
Related official references
Officially documented companions: CODE, UNICHAR, UNICODE, and CONCATENATE.
Source scope, date and validation disclosure
- KDE stable-KF6 function handbook — documented syntax and example; checked 2026-10-11. The stable handbook is not a native runtime test.
- Calligra 26.08.2 function registration — official version-pinned source, checked 2026-10-11.
- Official Calligra XML help for text functions — shipped argument-type definitions, checked 2026-10-11.
- KDE 26.08.2 release announcement — release 2026-10-08; checked 2026-10-11.
Validation: Official documentation, immutable implementation and independent code-point calculations were checked. No native Calligra execution, installed-platform checks, glyph rendering or workbook interchange tests were performed.