DICOM Character Sets and Patient Names Explained
- Specific Character Set (0008,0005) governs text fields like Person Name but defaults to 7-bit ASCII if omitted.
- Person Name values use up to 5 caret-separated components and up to 3 equals-separated representation groups.
- Multi-valued character sets use ISO 2022 escape sequences to switch encodings within one dataset.
- ISO_IR 192 (UTF-8) must be single-valued and cannot combine with other character set values.
- Garbled text usually comes from ignoring (0008,0005) or decoding bytes with the wrong assumed encoding.
In DICOM, Specific Character Set (0008,0005) tells software parsers which character encoding maps raw bytes into text characters. It governs patient names, textual clinical reports, and string attributes. If a file omits this attribute, the DICOM standard mandates a default 7-bit ASCII character repertoire (ISO-IR 6).
When your cloud platform receives medical records from hospitals worldwide, names contain accented letters, non-Latin alphabets, and ideographic scripts. A patient named Müller, Élodie, or 山田太郎 displays as corrupted text if your ingestion service misinterprets encoding tags. Understanding character sets helps you build resilient data pipelines that preserve patient identity accurately.
Which DICOM attributes use Specific Character Set?
Specific Character Set (0008,0005) applies only to text Value Representations (VRs). These include Person Name (PN), Short String (SH), Long String (LO), Unlimited Characters (UC), Short Text (ST), Long Text (LT), and Unlimited Text (UT).
All other DICOM attributes ignore (0008,0005) completely. Identifiers such as Application Entity (AE) titles (AE), Unique Identifiers (UI), Code Strings (CS), Dates (DA), and Times (TM) must always use basic 7-bit ASCII.
For example, you cannot use accented letters or non-Latin glyphs in an AE title or a Study Instance UID. Trying to write UTF-8 bytes into a CS element violates PS3.5 Section 6.2. Scanners and PACS archives reject datasets that break this boundary.
How does the Person Name (PN) Value Representation work?
The Person Name (PN) Value Representation structures human names into up to 5 component fields. Carets (^) separate the fields, and equals signs (=) separate up to 3 representation groups.
The 5 component fields follow a strict hierarchy:
Family^Given^Middle^Prefix^Suffix
A typical Western name encodes like this:
Smith^John^Robert^Dr^Jr
Trailing empty fields do not require delimiter characters. A name with only family and given names encodes simply as Smith^John. If an intermediate field is missing, you must keep its caret delimiter. For example, Smith^^Robert represents a person with no recorded given name.
To support international healthcare, DICOM allows up to 3 component groups separated by equals signs:
Single-byte Alphabetical = Ideographic = Phonetic
Consider a Japanese patient name:
Yamada^Tarou=山田^太郎=やまだ^たろう
The first group holds the single-byte Latin transliteration (Romaji). The second group contains ideographic kanji characters. The third group contains phonetic hiragana readings. If your ingestion code splits strings on commas or spaces, it scrambles these structured components.
How do single-byte sets differ from ISO 2022 code extensions?
DICOM supports single character sets that replace the default repertoire, as well as multi-valued sets that switch encodings using ISO 2022 escape sequences.
When (0008,0005) contains a single value, that character set applies across the entire dataset. Common single-byte values include:
ISO_IR 100: Latin Alphabet No. 1 (ISO 8859-1), covering Western European languages like French, German, and Spanish.ISO_IR 101: Latin Alphabet No. 2 (ISO 8859-2), covering Central and Eastern European languages like Polish and Czech.ISO_IR 144: Cyrillic alphabet (ISO 8859-5).ISO_IR 126: Greek alphabet (ISO 8859-7).
When a dataset needs multiple scripts, (0008,0005) becomes a multi-valued string separated by backslashes \. For example, ISO 2022 IR 13\ISO 2022 IR 87 allows mixing Latin characters with Japanese JIS X 0208 characters.
In multi-valued sets, the byte stream embeds invisible ISO 2022 escape sequences (ESC 0x1B followed by 2 or 3 bytes). These sequences instruct the parser to switch its active character table on the fly. If a parser does not implement stateful ISO 2022 decoding, it treats escape sequences as printable characters, corrupting patient records.
Why do modern cloud systems prefer UTF-8 (ISO_IR 192)?
Setting Specific Character Set to ISO_IR 192 designates Unicode UTF-8 encoding across all text elements in the DICOM dataset.
UTF-8 represents any character from any human language within a single variable-length byte scheme. It removes modal ISO 2022 escape sequences and stateful parser switching. A single UTF-8 text element can hold mixed English, Arabic, Chinese, and Greek text without special control characters.
According to PS3.3 Section C.12.1.1.2, ISO_IR 192 must be single-valued. It cannot be combined with code extension values or other character sets.
Although UTF-8 is the global standard for web applications and modern cloud software, many hospital scanners still run legacy software from the 2000s. You will regularly encounter scanners that only output ISO_IR 100 or ISO 2022 multi-byte streams. Your cloud pipeline must be ready to ingest what the scanner sends.
What causes garbled text bugs (mojibake) in DICOM feeds?
Garbled text in DICOM happens when an application decodes raw element bytes using a default system character set instead of inspecting (0008,0005).
Here are 4 common real-world failure modes:
- Missing (0008,0005) with 8-bit characters: A scanner writes French names with accents (such as byte
0xE9foré), but omits(0008,0005). Under DICOM rules, the file defaults to 7-bit ASCII. A strict parser drops the byte or raises a decoding error. - Decoding UTF-8 bytes as Latin-1: If a modality sends UTF-8 (
ISO_IR 192), the characteréencodes as two bytes:0xC3 0xA9. If your parser blindly decodes those bytes as ISO-8859-1, the name displays asé. - Truncating strings by byte length instead of character count: Multi-byte characters in UTF-8 or Asian code pages take 2 to 4 bytes per glyph. Slicing a string at a fixed byte offset can cut a character in half, creating invalid Unicode bytes.
- Stripping caret delimiters on intake: Some developers replace carets
^with spaces before storing records. This permanently destroys the distinction between family, given, and middle names, making patient matching fail downstream.
How should your ingestion pipeline normalize patient names?
An ingestion pipeline should parse raw DICOM text according to (0008,0005) immediately upon receipt and normalize all internal text attributes into valid UTF-8.
You can handle text normalization in 3 steps:
- Extract and decode: Inspect
(0008,0005)first. Use a standard-compliant library (such as DCMTK or pydicom) to decode raw bytes into native strings according to the declared character set. - Structure the components: Parse
PNstrings by splitting on equals signs=for representation groups, and carets^for individual name parts. Store family, given, middle, and prefix values in separate schema fields. - Retain raw files: Keep the original, untouched DICOM Part 10 file in object storage. If a patient matching dispute arises during a clinical audit, you have the exact bitstream the scanner transmitted.
Receiving studies from diverse hospital modalities requires managing inbound TLS connections and varied transfer syntaxes. Building and maintaining internet-facing DICOM listeners across multiple healthcare facilities requires ongoing ops overhead.
Dicomly handles inbound connectivity for you by terminating the association securely. It streams the original DICOM dataset to your cloud webhook via DICOMweb STOW-RS over HTTPS. You give up custom DIMSE association hooks, but you avoid running listener servers. This lets your team focus on data normalization and your core medical product.
What to test first in your development lab
Test your ingestion service with test DICOM files containing accented European names, multi-component names, and Asian ideographic character groups.
You can verify how tools inspect character sets using dcmdump from the DCMTK toolkit:
dcmdump --search 0008,0005 test-study.dcm
dcmdump --search 0010,0010 test-study.dcm
Check that your parser decodes (0010,0010) into clean UTF-8 without throwing encoding exceptions or leaving raw escape bytes in strings. To set up a repeatable testing environment with local modalities, follow our guide on building a local DICOM test lab with Docker.
Dicomly builds infrastructure for healthcare software teams that receive DICOM studies from hospitals. Why we built Dicomly →