Page 2 of 2

Re: Converting encoded strings

Posted: Mon Sep 01, 2014 4:39 pm
by Nunners
Ok - so it's nearly 11pm here.. and I've finally got it...

If I make sure the header is always utf-8 it works... so simply adding

Code: Select all

header('Content-Type: text/html; charset=utf-8');
Before handling any of this works... I can see why, but not, if you get what I mean...

Thanks for your help though... it did help to sanitise that what I was doing should have been correct!

Re: Converting encoded strings

Posted: Mon Sep 01, 2014 4:44 pm
by Celauran
So PHP was doing it right all along and the browser was mucking it up due to a bad encoding? Well, glad it's sorted.

Re: Converting encoded strings

Posted: Mon Sep 01, 2014 4:54 pm
by Nunners
Yeah - all sorted... however it wasn't wholly the browser...

The main area I was having problems with was actually in CLI, but this was primarily fixed by changing the headers - odd I know, but it works!