Avoid warnings for and detect the problem: Warning: json_encode(): Inval...

...id UTF-8 sequence in argument occurred