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
Tim Swann
June 04, 2015
Technology
75
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Tim Swann
See All by Tim Swann
PHP Collection Classes | PHPBelfast
faffyman
0
780
Graph data with Neo4J PHP & Neoxygen
faffyman
0
2k
Other Decks in Technology
See All in Technology
FDE という解 ― 暗黙知と明示知をつなぐ、伴走型エンジニアリング ―
otanet
0
150
AWSシリコン最前線 〜AI時代のチップ選択を読み解く〜
htokoyo
2
570
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
2
250
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
4
650
2026TECHFRESH畢業分享會 - AI 時代的人生存檔點
line_developers_tw
PRO
0
960
やさしいA2A入門
minorun365
PRO
12
1.8k
Disciplined Vibes: Scaling AI-Assisted Engineering
sheharyar
0
140
新しいVibe Codingと”自走”について
watany
6
310
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
310
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
140
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
2
630
脆弱性対応、どこで線を引くか
rymiyamoto
1
380
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.8k
GitHub's CSS Performance
jonrohan
1033
470k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
250
How STYLIGHT went responsive
nonsquared
100
6.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
410
A Tale of Four Properties
chriscoyier
163
24k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Agile that works and the tools we love
rasmusluckow
331
21k
KATA
mclloyd
PRO
35
15k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
190
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