Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Converting Legacy Applications To UTF-8
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Tim Swann
June 04, 2015
Technology
0
72
Converting Legacy Applications To UTF-8
What are all the angles to be considered when you decide to standardise your text to UTF-8
Tim Swann
June 04, 2015
Tweet
Share
More Decks by Tim Swann
See All by Tim Swann
PHP Collection Classes | PHPBelfast
faffyman
0
770
Graph data with Neo4J PHP & Neoxygen
faffyman
0
2k
Other Decks in Technology
See All in Technology
OpenShiftでllm-dを動かそう!
jpishikawa
0
120
AWS Network Firewall Proxyを触ってみた
nagisa53
1
240
2026年、サーバーレスの現在地 -「制約と戦う技術」から「当たり前の実行基盤」へ- /serverless2026
slsops
2
250
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.5k
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
170
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
240
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
Context Engineeringの取り組み
nutslove
0
360
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.3k
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
470
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.3k
Designing Experiences People Love
moore
144
24k
Amusing Abliteration
ianozsvald
0
100
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
How to make the Groovebox
asonas
2
1.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Mind Mapping
helmedeiros
PRO
0
88
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
150
Information Architects: The Missing Link in Design Systems
soysaucechin
0
780
Facilitating Awesome Meetings
lara
57
6.8k
Transcript
CHARACTER FLAWS CHANGING A LEGACY APPLICATION TO UTF-8 June 4th
2015
• Legacy Applications are a mish-mash of encodings • Ever
dealt with Irish names? • French / German / Eastern European? • What about a €uro Symbol? THE PROBLEM
Standardise your character encoding THE SOLUTION Simple - Right?
<?php header('Content-Type: text/html; charset=UTF-8') ; ?> <meta http-equiv="Content-Type"
content="text/html; charset=UTF-8" /> <meta charset="UTF-8" /> HEADERS All Done… …Just Like Austria in 1982 - Pack up and go home
Set Character Encodings Everywhere CHARACTER IN ≠ CHARACTER OUT Front
End Pages ✔ Database ✔ Tables ✔ Columns ✔ Forms ✔ Server(s) ✔
DATABASE SET NAMES utf8 ; Connections Need to be UTF-8
Aware
DATABASE ALTER DATABASE database_name DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
Create a UTF-8 Database
DATABASE Change Existing Tables to UTF-8 ALTER TABLE table_name DEFAULT
CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
DATABASE ALTER TABLE table_name CHANGE title title VARCHAR( 128 )
CHARACTER SET utf8 COLLATE utf8_unicode_ci ; Columns Need to be UTF-8
FORMS <form action=“post.php" method="post" enctype="multipart/form-data" accept-charset="UTF-8" > POST only
UTF-8 data
PHP INI default_charset = "utf-8"
PHP TEXT CONVERSION <?php utf8_encode ( $string) ; PHP Functions
Only Encodes ISO-8859-1 Strings
PHP TEXT CONVERSION <?php iconv('ISO-8859-1', 'UTF-8//TRANSLIT', $string); // Translit
= find a similar char e.. ä => a mb_convert_encoding($string, 'UTF-8', ‘ISO-8859-1') // requires php-mbstring extension for multi-bytue support PHP Functions
PHP TEXT CONVERSION <?php htmlentities ( $string, ENT_QUOTES, 'UTF-8') ;
PHP Functions Specify encoding when escaping output
PHP TEXT CONVERSION <?php new UConverter([ string $destination_encoding [, string
$source_encoding ]] ) $unconvertor->convert( $string ) ; Since PHP 5.5 - UConvertor
PHP SOURCE FILES - YOUR IDE All Team members should
have same settings