How do I support Romanian diacritics (ș/ț/ă/â/î) properly in Magento?
This is one of the most common Romanian Magento bugs, incorrectly encoded diacritics showing as ? or à in product names, customer addresses, transactional emails, and invoice PDFs.
Three layers to get right:
- MySQL collation, the database must use
utf8mb4_unicode_ci(Magento default) or ideallyutf8mb4_romanian_cifor the customer-name / product-name columns.utf8alone (3-byte) breaks on some symbols. Convert withALTER TABLE ... CONVERT TO CHARACTER SET utf8mb4. - PHP / Magento config,
app/etc/env.phpmust specify the charset,default_charsetinphp.inishould beUTF-8, andMagento\Framework\Localemust be configured forro_RO. - Output layer, HTML
<meta charset="utf-8">, email templates set as UTF-8 (not Latin-2 or Windows-1250 which some legacy ESPs default to), PDF invoices generated with TCPDF or DOMPDF must explicitly embed a font that includes Romanian glyphs (DejaVu Sans is the safe pick; Helvetica doesn’t cover them).
We audit all 3 layers + run a diacritics-stress-test (sample order with name “&Ș;tefân Țicleanu”) on every RO build before launch.