Lesson 1.2: Rich Text vs. Plain Text
Breaking out of the spreadsheet and word processor mindset
1. Human Impact & Context
When you type in a traditional word processor like Microsoft Word or Google Docs, the software actively assists you. It automatically turns straight quotation marks into curved "smart" or typographical quotes (“ ”), capitalizes the first word of every sentence, autocorrects spelling, and embeds hidden visual formatting like font families, colors, and margins.
For writing an essay or a business letter, these features are helpful. In localization engineering, they are destructive.
When localized text is fed into an application, a video game engine, or a subtitle renderer, the software expects raw, plain text. Word processor "helpfulness" introduces invisible formatting artifacts and illegal typographical characters that break code syntax, cause software crashes, or corrupt multi-lingual string rendering:
The Broken UI: A translator uses Google Docs to edit a French JSON UI file. Google Docs converts straight quotes into smart quotes (“ ”). When saved, the app parser fails to recognize string boundaries and crashes on startup.
The Invisible Character Bug: Word processors insert non-breaking spaces or hidden rich-text tags (<font>, <span>) that appear blank on screen but cause automated build tools to reject localized files.
To protect language meaning across global boundaries, localization engineers work exclusively in plain text, preserving raw character data without uninvited software alterations.
2. Core Mechanics & Technical Concepts
Rich Text vs. Plain Text
Understanding the distinction between these two text paradigms is essential for maintaining code integrity across pipelines:
Swipe or scroll sideways to see more.
Feature | Rich Text (.docx, .rtf, Google Docs) | Plain Text (.json, .vtt, .xml, .csv) |
Primary Purpose | Visual layout, document printing, human presentation. | Direct data structure, code execution, machine reading. |
Underlying Data | Text content mixed with complex styling XML/binary tags. | Pure character codes (bits and bytes) mapping directly to standard character sets. |
Quotation Marks | Automatically converted to typographical "curly" quotes (“ ”). | Strictly preserves standard ASCII straight quotes (" or '). |
Editor Compatibility | Requires specialized word processors or document viewers. | Readable and editable in any text editor or IDE (e.g., VS Code). |
Why Smart Quotes Break Code Syntax
In almost all software languages and structured data formats (such as JSON, XML, and WebVTT), the standard straight double quote (") is an architectural symbol. It acts as a strict boundary delimiter that tells the computer: "Everything inside these two straight quotes is human-readable text."
JSON
"btn_start": "Start Game" <-- VALID: Straight quotes define key and value boundaries.
“btn_start”: “Start Game” <-- INVALID: Curly quotes are unparseable code symbols.
When a word processor substitutes curly quotes (“ or ”), the computer parser no longer sees a string boundary. Instead, it encounters an unrecognized Unicode character, resulting in a fatal syntax error (e.g., Unexpected token “).
Escape Characters: Inclusion Through Backslashes
What happens when natural human dialogue contains double quotation marks inside a localized string value?
English Source: "The captain said, "Fire!" and jumped."
Broken Code: "dialogue": "The captain said, "Fire!" and jumped."
In the broken example above, the computer interprets the quote before Fire! as the end of the string value, causing a fatal syntax crash on the word Fire!.
To include literal quotation marks inside a string without ending the boundary, localization engineers use an escape character—a backslash (\) placed immediately before the inner quote:
JSON
"dialogue": "The captain said, \"Fire!\" and jumped."
The backslash tells the software parser: "Do not treat the following quote as a code boundary. Treat it as a literal character to display on screen to the end user."
3. Real-World Industry Application
┌─────────────────────────────────────────┐
│ Rich Text vs. Plain Text Risks │
└────────────────────┬────────────────────┘
│
┌─────────────────────────────────┼─────────────────────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Software UI │ │ Game UI │ │ Linear Media │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
▼ ▼ ▼
JSON Key Boundaries Dialogue Quoting Subtitle Captions
Curly quotes break string Unescaped spoken dialogue Smart quotes cause subtitle
parsing, disabling app quotes crash dialogue boxes renderers to display broken
buttons globally. mid-game. symbol glyphs on screen.
Software UI: Key-value JSON files require strict straight quotes. An unescaped quote in a German string like "button": "Anmelden "JETZT"" will prevent the web app from building until corrected to "button": "Anmelden \"JETZT\"".
Game Localization: Video game dialogue frequently features spoken quotes inside spoken lines. Using backslash escape sequences ensures in-game speech bubbles render quotation marks correctly during gameplay.
Linear Media (Subtitling): Captions exported from rich-text software often carry invisible formatting tags or smart quotes that cause media playback engines to fail timing synchronization or render corrupted glyphs on streaming platforms.
4. Cross-Platform Execution (Sanitizing Text in VS Code)
When working in Visual Studio Code on either macOS or Windows, you can quickly sanitize rich-text errors and convert smart quotes back to valid code syntax.
Global Find & Replace for Smart Quotes
Open the file in VS Code.
Open Find and Replace:
macOS: Cmd + Option + F
Windows: Ctrl + H
In the Find box, paste the curved quote (“ or ”).
In the Replace box, type a standard straight quote (").
Click Replace All (Cmd + Option + Enter on macOS / Ctrl + Alt + Enter on Windows).
Identifying Syntax Highlights
VS Code uses visual diagnostics to highlight broken syntax. Lines with unescaped quotes or invalid curly quotes will display red squiggly underlines and turn the line number red in the gutter.
Open the Problems Panel (Cmd + Shift + M on macOS / Ctrl + Shift + M on Windows) to view a list of every syntax error in the active file.
5. Next Steps & Lab Practice
Now that you understand why word processor artifacts break code structure and how escape characters resolve string conflicts, you are ready to put these concepts into action.
Proceed to 🛠️ Hands-On Lab 1.2: Rescuing Code from Rich Text Corruption, where you will fix a damaged multi-lingual string file, convert curly quotes using global replacement, and escape inner quotation marks in VS Code.
If there are any other specific lessons, labs, or instructor guides from Module 1 that you'd like me to output directly in the chat for easy copying, just name the file! Otherwise, we can jump right into Module 2: Respecting Global Alphabets & Accents.
Ready to move on?
Mark this lesson complete when you’re ready.