I have a series of fields on a View. For some reason, any node title field with an apostrophe in it is being returned to my endpoint as Jen's Cupcake Store instead of Jenn's Cupcake Store.

Any idea how I can fix this? Been at it for a few days now and I can't seem to find a single solid solution. Help is appreciated!

  • The string has been passed through htmlspecialchars, which is what Twig does to escape HTML: ``` php > echo htmlspecialchars("Jenn's Cupcake Store"); Jenn's Cupcake Store ```
    – cilefen
    May 13, 2022 at 12:28
  • 1
    This is done on purpose, otherwise a value returned from an endpoint would have apostrophes, breaking the response. Each programming language should have a function for decoding HTML entities. Decode the value on the receiving end, as its properly encoded for transport.
    – Jaypan
    May 13, 2022 at 16:40
  • Try with htmlspecialchars_decode() or html_entity_decode().
    – Vinodhini
    Jun 8, 2022 at 8:50


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.