Data On Demand, one-stop data solution
Markets Local sources. Your time zone.

Teams in five regions rely on us for local-language, multi-currency data.

Global coverage
Company A decade of data expertise.

An in-house team of 20+ engineers and analysts serving clients in 12+ countries.

About us
Blog

Arabic text in data pipelines: encoding, direction and matching

Practical lessons on handling Arabic in scraped data, from broken encodings and right-to-left display to transliteration and fuzzy matching.

19 May 2026 · 6 min read · Data engineering · Middle East & GCC

Arabic content is central to web data in the GCC. Product names, store locations, property descriptions and reviews are frequently published in Arabic, in English or in both. Pipelines built for Latin-script data tend to fail on Arabic in predictable ways. This post covers the problems we see most often and how we handle them.

Encoding: get it right at the boundary

The most visible failure is mojibake, where Arabic arrives as strings of accented Latin characters or question marks. It almost always happens at a boundary: a page served in a legacy Arabic code page and read as UTF-8, or a correct UTF-8 file opened by a tool that assumes another encoding.

  • Detect the source encoding from response headers and page metadata, and verify it on a sample.
  • Convert to UTF-8 once, at ingestion, and keep UTF-8 throughout.
  • When delivering CSV for spreadsheet users, include a byte order mark, or many tools will misread the file.
  • Run an automated encoding check on every delivery: count replacement characters and unexpected Latin-1 sequences.

Unicode normalisation

Two strings that look identical can be different sequences of code points. Arabic has presentation forms, which are legacy code points for letter shapes, and some sources still emit them. Normalising to a standard Unicode form, typically NFC for storage and NFKC for matching, removes many of these differences. Normalisation should be applied deliberately and recorded, because NFKC can change characters in ways that matter for display.

Right-to-left and mixed direction

Arabic is written right to left, but product titles often embed Latin brand names, model numbers and Western digits. Display software uses the Unicode bidirectional algorithm to order these runs, and results can surprise. A title such as a brand name followed by an Arabic description and a capacity can appear scrambled in a spreadsheet cell, even though the underlying data is correct.

The key point for data teams is that display order and storage order are different. Never "fix" a string by reversing it to make it look right in one tool. Store the logical order, and address display issues in the presentation layer.

Store Arabic text in its logical order and fix display in the presentation layer. Reversing strings to make them look right in one tool breaks them everywhere else.

Digits

Arabic-language pages may use Eastern Arabic digits (٠١٢٣٤٥٦٧٨٩), Persian variants in some sources, or Western digits. Prices and pack sizes must be converted to Western digits before parsing. The Arabic decimal separator and thousands separator also differ from Latin forms, so number parsing needs explicit handling rather than a generic conversion.

Matching Arabic text

Arabic spelling varies in ways that are harmless to readers and damaging to exact-match logic. For matching purposes, a light normalisation removes most of this variation without changing meaning.

VariationExampleMatching treatment
Alef formsأ, إ, آ and اMap to bare alef
Taa marbutaة and ه at word endMap to a single form
Final yaaى and يMap to a single form
DiacriticsShort vowel marks, often partialRemove
TatweelDecorative letter elongationRemove
Definite articleال prefix present or absentCompare with and without

Apply these rules to a matching key, not to the stored text. The original string is what the source published and what any client-facing output should show.

Transliteration

Names written in Latin script have no single standard form. The same place, brand or company name may be spelt with different vowels, with or without a hyphenated article, or with different letters for sounds that English lacks. Mohammed and Muhammad are the familiar example, but product brands and district names vary in the same way.

  • Maintain alias tables for brands, districts and cities, reviewed by a native speaker.
  • Use phonetic or character n-gram similarity for candidate generation, then confirm with attributes.
  • Where both Arabic and English names are available, match on both and require agreement.
  • Do not auto-transliterate for display unless a client specifically asks for it.

Search and tokenisation

Arabic words carry attached prefixes and suffixes, such as conjunctions and pronouns, so whitespace tokenisation produces many variants of the same root word. For search and classification, light stemming helps. For product matching, it is usually better to extract structured attributes, such as brand, size and variant, and match on those rather than on free text.

Quality checks we run

  1. Encoding check on every field expected to contain Arabic.
  2. Script detection to confirm Arabic fields contain Arabic and English fields contain Latin script.
  3. Digit conversion check on numeric fields parsed from Arabic pages.
  4. Spot review by an Arabic-reading analyst on a sample of each delivery.
  5. Comparison of Arabic and English attribute values where both exist.

None of this requires exotic tooling. It requires treating Arabic as a first-class part of the pipeline from the start, rather than a special case handled after something breaks.

Put it into practice

See your own data before you commit.

Name the sources and fields you need. Within 24–48 hours you receive a real sample from your target sites, in your format, free of charge.

Request a free sample Talk to a data engineer Sample in 24–48 hours · NDA on request · Any format, any schedule