Software and Game Localisation 6 August 2026
What Are Escape Sequences? Hidden Characters in Software Strings
Hidden characters in software strings are the place where translation breaks most often. We explain what escape sequences do and why they have to be preserved exactly.
In software translation the most insidious errors are usually hidden not in the visible words but in the invisible characters. Odd marks that turn up inside a string can look like typing slips to an inexperienced eye and get deleted. In fact they are escape sequences, silent instructions that decide how the text will appear on screen.
Contents
Escape sequences are the most technical of the non-translatable elements. When a translator does not recognise them, the line layout shifts, the text comes out corrupted or the program throws an error. This article explains what escape sequences are, which languages they come from and why they have to be preserved exactly in localisation.
What are escape sequences?
An escape sequence is a run of marks which, inside a string or a character, stands for something other than itself and is converted into a character that would be awkward to type directly (Esselink, 2000). The best known of them is the combination of a backslash and the letter “n”; this makes the text move to a new line at that point. What appears on screen is therefore not the letter “n” but a line break.
The structure was born in the C and C++ programming languages, and from there it was copied into Java, PHP and others (Jiménez-Crespo, 2024). The backslash opens an “escape”: the character that follows it steps out of its ordinary meaning and takes on a special function. That is why these marks are called escapes.
The critical point for the translator is this: escape sequences are not visible text but formatting commands. Wherever they stand in the source string, they have to stand at their functional equivalent in the target string. Deleting them or translating them breaks the behaviour of the program.
The most common escape sequences
The number of escape sequences is limited and most of them are the same in every language. The table below summarises the escape sequences seen most often in software strings, together with what they do.
| Escape sequence | Meaning | Effect on screen |
|---|---|---|
| Backslash + n | New line | The text moves to the next line |
| Backslash + t | Horizontal tab | The text is indented |
| Backslash + r | Carriage return | Takes the cursor to the start of the line |
| Backslash + backslash | The backslash character | A single backslash is printed |
| Backslash + a | Alert (beep) | Gives an audible warning |
What these sequences have in common is that each of them corresponds to a single visible character or to a behaviour. A double backslash, for example, is used to show a real backslash in the text, because a single backslash would open an escape and cannot stand on its own. This comes up frequently in file paths.
The difference between escape sequences and placeholders
Translators often confuse escape sequences with placeholders, yet the two do different jobs. A placeholder is a gap that begins with a percent sign and is filled with a value at run time; a name, a number or a file name goes into it. An escape sequence, on the other hand, is never filled with a value; it only produces a formatting effect.
The distinction matters in practice. A single string can carry both a placeholder and an escape sequence side by side: an error message may display a value first and then move to a new line. The translator has to recognise both, leave both untouched, and yet reorganise their positions where the syntax of the target language calls for it.
In languages such as German or Turkish, where the position of the verb or of the suffixes can change, the order of the parts before and after the new-line mark becomes important. In cases like this the escape sequence is held in place while the text around it is rebuilt.
What happens if they are handled wrongly?
Interfering with escape sequences is classified as a technical text error in localisation quality analysis. The most common mistake is deleting the backslash by accident, or breaking the sequence apart by letting a translated word slip into the middle of it. The result is usually two lines running into one another, or text that does not appear at all.
Some translation tools lock these characters as “tags” and stop the translator from breaking them by accident. Quality control (QA) functions also compare the number of escape sequences between source and target and flag any mismatch. These automatic checks catch overlooked errors before delivery.
Even so, automatic checking does not solve everything; the translator has to know what these characters do. In the technical resources in our knowledge centre we look in more detail at how placeholders and escape sequences can be carried across safely.
The path the translator should follow
There is a safe order to follow when working with escape sequences. It prevents both wrong deletion and wrong positioning.
- Identify every escape sequence and placeholder in the source string.
- Confirm that they are not visible text but formatting commands.
- Preserve these marks exactly as they are while you translate; do not translate them.
- Adjust only their positions, and only where the syntax of the target language requires it.
- Use a QA check to confirm that the numbers match between source and target.
Simple as these steps look, they are among the points most often skipped in software localisation. For a disciplined translator, escape sequences are not a trap but a routine item on the checklist.
Which files do escape sequences turn up in?
Escape sequences are not specific to any one file format; they appear almost anywhere that shares the coding tradition of C and its descendants. Portable object files, resource files, mark-up based structures and strings delivered as spreadsheets can all hold these characters. Whatever the file format, then, the translator has to show the same care.
Double backslashes are especially common in strings that store file paths; this is the only way to show a single backslash in the text. Strings that define date and time formats work on a similar logic: the letters inside them are not visible text but format codes tied to internal variables, and they must not be altered. In strings of this kind the only thing to be translated is the real visible text, if there is any.
The more context the file format gives the translator, the easier it becomes to carry escape sequences across correctly. A well-prepared resource file marks these characters as separate elements and makes it harder for the translator to break them by accident. Files converted into plain text, stripped of their context, are the formats that produce the most errors.
The limits of automatic checking
Modern translation tools protect escape sequences to a large extent. Quality control functions compare the number of these characters between the source and target strings; if there is a mismatch, the error is flagged. This automatic checking catches many overlooked errors before delivery and makes the process markedly safer.
Automatic checking has its limits, however. A tool can count the backslashes correctly, but it cannot tell whether a backslash sits in the right place for the syntax of the target language. If the order of the parts before and after the new-line mark is wrong, the text will look broken even when the check gives it a green light.
Automatic checking therefore completes the translator’s knowledge but does not replace it. A translator who knows what escape sequences do also prevents the errors of sense and layout that the tool cannot catch. A process in which technology and human judgement work side by side gives the most reliable result.
Why is the escape tradition English in origin?
Understanding why escape sequences exist makes it easier to carry them across correctly. The shared language of programming and coding is English; commands, file names and technical structures therefore derive from English terms. Escape sequences are part of that tradition, and they were copied from C and C++ into today’s languages.
This origin follows the same logic as many other non-translatable elements the translator meets: commands written in capitals, words joined with underscores, file paths and debugging messages. They all look like visible text but are in fact part of the code. Escape sequences fall into exactly this category.
A good software translator therefore knows not only two languages but also this shared language of the development world. Being able to tell which mark is visible text and which is code is a basic competence of technical translation. A translator who cannot draw that line risks breaking the product, however good their grammar may be.
The Türkiye context
In software translated into Turkish, escape sequences call for particular care where the line layout is concerned. The free word order and the agglutinative structure of Turkish may make it necessary to change the order of the parts before and after the new-line mark. In that case the mark is preserved, but the sentence around it is rebuilt.
Localisation work in Türkiye is mostly done from English, and the source strings are usually written in the English coding tradition. This means the translator has to know the escape tradition of C and its descendants. In this field the quality gap between a translator who has that knowledge and one who does not is wide.
Problems with the encoding of Turkish special characters are also bound up with this technical layer. Wrong encoding leads to corrupted text in much the same way as an escape sequence error does. In Turkish projects, character encoding and escape sequences should therefore be checked together.
What does this mean for you?
If you are having your software translated, escape sequences should be one of the criteria you use when choosing a translator. A translator who does not recognise these characters may break your product technically even while producing a translation with flawless grammar. Who does the work matters as much as the translation itself.
- Deliver the translation files in a proper resource format (PO, XLIFF and so on), not as plain text.
- Make sure that a translation tool which locks escape sequences is being used.
- Compare the number of these marks with a QA check after delivery.
- Review the localised version in the real interface for line layout.
You do not have to provide these safeguards on your own. Technical checking is applied as standard within our software localisation services; for details you can get in touch with us. Our aim is that your product works the same way in every language.
Frequently asked questions
What is an escape sequence?
It is a special sequence of marks inside a string that does not stand for itself but turns into another character. The combination of a backslash and n, for example, creates a new line on screen.
Are escape sequences translated?
No. They are formatting instructions, not visible text. If they are translated or deleted by mistake, the text looks corrupted or the line layout shifts.
Are an escape sequence and a placeholder the same thing?
They are not. A placeholder is filled with a value at run time; an escape sequence produces an invisible formatting effect such as a carriage return or a tab. Both are preserved, but their functions differ.
Which escape sequences are met with most often?
New line, tab and backslash are the most widespread. Others, such as the alert sound, backspace and carriage return, also come from C and its descendants.
Sources
- Jiménez-Crespo, M. A. (2024). Localization in Translation. Routledge (Ch. 8).
- Esselink, B. (2000). A Practical Guide to Localization. John Benjamins.
- Mick, J. (2015). A guide to non-translatable elements in software strings.