Please clarify... There is no space or other character between Mae and L, right?

The quote mark might be the issue, but we need to see this in a little more detail. The embedded quote mark should be escaped, according to the JSON standard. The problem with getting "more detail" is that when you copy and paste, it comes with some assumptions - the article about character encoding explains what is happening. What you see in the browser is encoded according to the character set of the browser. What you see in the database is encoded according to the character set of the database. And any data you create in PHP is encoded according to the character set in effect at the time the data was created. To make matters worse, some text editors will coerce the data into their own encoding scheme. If any of these character sets are mismatched (eg: database has UTF-8 characters, but the browser is using ISO-8859-1) the outcomes are unpredictable.

This means that you cannot depend on what-you-see-is-what-you-get if you're looking at a browser display of the data, or if you're looking at the text once you have copied it into a text editor.

TL;DR All of your character encoding schemes must be consistent from beginning to end. And if you're using JSON anywhere along the way, that means all of your character encoding schemes must be UTF-8.

If you want to pursue this further, please show us a link that will give us a way to read the information directly into a program, without going through a copy / paste or browser display. You might be able to dump that row from the database into data with var_export(). Or you might be able to copy it into a flat file, so you can post a link here. If we can get the information, we can show you how to break it apart into its byte-by-byte representations, and into its character-by-character representations. Once upon a time, a byte == a character, but the world has changed and this is not true any more.

This is the sort of script I would use to examine the character encoding and the hex byte values.

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.

The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…