Skip to content

Helper object to move a website step by step from an old encoding to a new encoding (e.g. ISO-8859-1 to UTF-8)

License

Notifications You must be signed in to change notification settings

Musiksammler/page-encoding-conversion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

page-encoding-conversion

Helper object to move a website step by step from an old encoding to a new encoding (e.g. ISO-8859-1 to UTF-8)

#Usage:

##index.php:

mb_internal_encoding(PageEncoding::PAGE_ENCODING);
mb_http_output(PageEncoding::PAGE_ENCODING);
mb_http_input(PageEncoding::PAGE_ENCODING);
mb_language('uni');
mb_regex_encoding(PageEncoding::PAGE_ENCODING);
ini_set('default_charset', PageEncoding::PAGE_ENCODING);

##When reading data from the database:

return \PageEncoding\Conversion::toPage($databaseResult);

##When saving data to the database (pdo exmaple):

$query = "INSERT INTO ...";
$stmt->bindValue('username', \PageEncoding\Conversion::toDatabase($username);

##When outputting any data in the frontend or sending data to a template engine:

return \PageEncoding\Conversion::toPage($data);

About

Helper object to move a website step by step from an old encoding to a new encoding (e.g. ISO-8859-1 to UTF-8)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages