0

I am storing a registered trademark symbol with a product name in a mysql table. The table is utf8 unicode. When I render the page using Smarty templates I see Product® when I should be seeing Product®.

After stepping through I can see the right before the template is rendered the variable looks like Product® but after render it adds the strange  character. I also tested this by using the php utf8_encode() and can visibly see the character being added after the encoding.

How do I strip this character and render so it isn't shown. I've tried something like this:

        $product= str_replace('®', '®', $product);
        $product= html_entity_decode($product);

But still see the strange  character show up in the product name. I have seen different issues on SO regarding a similar character but now solutions as to how to deal with it.

bos570
  • 1,505
  • 2
  • 23
  • 45

1 Answers1

0

Sounds like "Mojibake", where ® becomes ®.

This discusses the various causes for such: Trouble with UTF-8 characters; what I see is not what I stored

Rick James
  • 135,179
  • 13
  • 127
  • 222