Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert unicode back to text - Wordpress JSON api

Working on a Wordpress feed on an external site and have encountered an issue with post titles that contain characters such as single quotes and dashes.

JSON output looks like this:

{"rendered":"Some title post text here – some text after dash"}

{"rendered":"‘Title text in quotes ’: More title text"}

What's the best way to convert these unicode characters back to text on the front end? At the moment it's displaying the unicode.

Thinking there must be a javascript solution. Ideally the solution would cover all bases.

like image 659
okass Avatar asked Aug 30 '26 01:08

okass


1 Answers

If you are working with VUEjs you can use the v-html directive

like image 87
Alon Gouldman Avatar answered Sep 01 '26 13:09

Alon Gouldman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!