Tx 08c91064a47d615f12a5e9c6f1d5500db5e56165@20099875

Included in block 20,099,875 at 2018-02-22 18:32:24 (UTC)


Raw transaction

ref_block_num45,841
ref_block_prefix2,453,969,998
expiration2018-02-22 18:42:18
operations
0.
0.comment
1.
parent_author""
parent_permlinkphp
authorzavz9t
permlinkphp-fix-for-utf-8-characters-when-using-filegetcontents-for-sites-in-iso-8859-1-charset
title"[PHP] Fix for UTF-8 characters when using file_get_contents() for sites in ISO-8859-1 charset"
body"During my work, when I used [Simple HTML DOM Parser](http://simplehtmldom.sourceforge.net/), I get noticed that my code was broken when it parses sites with ISO-8859-1 encoding...
I received such string:
```
HKM Lederreitstiefel CROCO Langl�nge/enge Weite
```
During googling I found solution:
```php
mb_convert_encoding($content, 'UTF-8', mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true))
```
It fixed previous case:
```
HKM Lederreitstiefel CROCO Langlänge/enge Weite
```
but it breaks another one:
```
["currency"] => string(2) "€"
```
#### Finally I changed it to:
```
mb_convert_encoding(
mb_convert_encoding($content, 'UTF-8', mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true)),
'HTML-ENTITIES',
'UTF-8'
)
```
And received such strings:
```
Kardätsche -Flower- für Kinder
```
---
It is better, but not good one. Simply adding ```html_entity_decode``` function in correct places and we finally received:
```
Kardätsche -Flower- für Kinder
```
Such solution rescued my project for parsing websites in different encoding.
#### I hope that it will help somebody. Have a nice day :-)
---
P.S. Many thanks for guys here: https://stackoverflow.com/questions/2236668/file-get-contents-breaks-up-utf-8-characters"
json_metadata{"tags":["php","blog","programming","charset","ua"],"links":["http://simplehtmldom.sourceforge.net/","https://stackoverflow.com/questions/2236668/file-get-contents-breaks-up-utf-8-characters"],"app":"steemit/0.1","format":"markdown"}
extensions[]
signatures
0.2022fe42c95123d678a18ea7bd110a73141ae92d0a5b9230743ff2295ebe5841e302635b56dd5952b63c9f5c44b0764e7644d8fdde0ebc2fa3ab08f324655a6770
transaction_id08c91064a47d615f12a5e9c6f1d5500db5e56165
block_num20,099,875
transaction_num31