Pull up a chair. Suppose you are testing a customer registration form and you type “Ramesh” in the name field. It saves. You type “Anita”. It saves. You write “pass” in the test log and go for chai. That is the test most of us run first, and it proves almost nothing about text handling. Let me show you why, because once you see it you will never look at a text field the same way again.
Four things we casually call “a character”
When you say “the name has five characters”, you might mean any of four different things, and software counts each differently.
- The grapheme cluster: what a reader perceives as one unit on screen.
- The code point: a number assigned by the Unicode standard, such as U+0905 for the Devanagari letter अ.
- The code unit: the chunk an encoding like UTF-16 works in.
- The byte: what actually lands in a file or database column.
For plain English letters all four are usually the same number, which is exactly why English-only test data hides the problem. Now try the Tamil word தமிழ். A reader sees three units: த, மி and ழ். But it is built from five code points, because மி is the consonant ம plus a vowel sign ி, and ழ் is ழ plus a pulli mark. Encoded as UTF-8, those five code points take 15 bytes. The Hindi word नमस्ते is similar: three visible clusters, six code points, 18 bytes in UTF-8.
Emoji add one more twist. The grinning face is a single code point, takes four bytes in UTF-8, but occupies two code units in UTF-16. In JavaScript, the length of that one emoji string is 2. So a front-end counter that says “1 of 20 used” and a back end that counts differently can disagree about the same input.
Where the gaps turn into bugs
Each of those counting differences has a classic failure waiting for it.
Truncation. Say a field allows 10 characters and the database column is sized in bytes (some databases measure column length in bytes, others in characters; check yours). A ten-letter English name fits. A six-letter Tamil name in code points may need 18 bytes and get cut. Worse, a cut in the middle of a multi-byte sequence leaves garbage, usually shown as a question mark or a diamond with a question mark inside. Even cutting by code points can slice a vowel sign off its consonant and leave a name that looks wrong but is technically valid. To find it, enter a name exactly at the limit in a non-Latin script, save it, reload the page, and compare what you typed with what comes back.
Emoji and the old MySQL setting are another pair. In MySQL, the character set called utf8 is actually a three-byte variant (utf8mb3). It cannot store four-byte characters, so an emoji in a feedback box can cause an error or silent loss, depending on the strict-mode setting. The fix is utf8mb4. As a tester you do not need to make the fix, but “does a smiley in the comment field survive?” finds the problem in thirty seconds.
Then there are look-alike characters. The letter “é” can be stored as one code point or as “e” followed by a combining accent. They look identical. A user who registers with one form and logs in typing the other may be told the account does not exist. The remedy is normalisation, a defined process (Unicode has several forms, NFC and NFD being the common ones) that converts text to one consistent representation before comparing or storing. Ask whether the system normalises, and try to break it.
The names your form assumes do not exist
Encoding is half the story. The other half is assumptions about what a name is. Many forms demand a first name and a last name, both mandatory, both at least two letters. In India that falls apart quickly. Plenty of people have a single name, as is common in parts of Tamil Nadu and elsewhere. Others use initials as part of a name, like “K. S. Radhakrishnan”, with spaces, dots and a two-letter lump that fails a minimum-length rule. Apostrophes and hyphens appear in names across the world (O’Brien, Anne-Marie), and an apostrophe is exactly the character a badly written query may choke on.
So build yourself a small, standing set of text inputs. Nothing fancy:
- A single-word name, and a name of just initials.
- A Tamil, a Hindi (Devanagari) and a Bengali name, each at the maximum length.
- A name with an apostrophe, one with a hyphen, one with leading and trailing spaces.
- One emoji, and one very long string of 500 characters.
- A name pasted from a Word document, which often carries curly quotes.
Use it everywhere text goes in, not just on the registration page: search boxes, address lines, support tickets, coupon codes, file names.
Following the text on its whole journey
Saving it is only the first hop. A name typed once may travel to a database, a search index, a PDF invoice, an SMS, an export to a spreadsheet and a payment gateway. Each hop can mangle it. So after you save a Devanagari name, follow it.
Check the confirmation email: does the subject line show proper letters? Download the invoice PDF: does the font actually contain those glyphs, or do you see empty boxes? Export the customer list to CSV and open it in Excel: does it show garbled text? (This last one is a well-known annoyance, since Excel often needs a byte-order mark to recognise UTF-8 in a CSV.) Send the SMS: some gateways switch to a different encoding for non-Latin text, which shrinks the number of characters allowed per message segment and can split one message into several. Whether that happens, and the exact limits, depend on the gateway and the regulations for that route, so confirm with whoever owns the integration.
Sorting is another quiet one. Sorting a list of names by raw code point order is not what a Tamil or Hindi reader expects from alphabetical order. Proper sorting uses locale-aware collation. If a customer list is meant to be sortable for Indian users, check it with names in more than one script.
What a good result looks like
Do not expect every system to support every script everywhere. A banking core might legitimately restrict names to a narrow character set because of downstream rules. That is a product decision, and it is fine, provided the failure is clear: a message saying which characters are not allowed, rather than a generic error, a blank screen or, worst, a silent substitution of question marks. Silent corruption is the real enemy. A rejected input is a feature; a corrupted one is a defect that surfaces months later on a legal notice with a wrong name.
One last habit. When you log a defect here, paste the actual text you typed, name the script, and mention the screen where it went wrong. “Special characters fail” tells the developer nothing. “Tamil name of 6 letters truncated to 4 on the profile page after save” can be reproduced in a minute.
Leave a Reply