This successfully generates a list of existing tags as options to choose from. If I manually type in a new tag which contains contains an apostrophe (e.g., “Women’s safety”), this seems to be stored normally and not encoded. So, all good so far.
The problem is that if I select that same saved tag as an option in another page, it actually generates an encoded new tag entry as follows:
Women's safety [note: new saved tag]
Women's safety [note: original saved tag]
There seems to be an inconsistency in the way this is handled. If I just type in “Women’s safety” again, it doesn’t create a new encoded tag, it stores it as per the original saved tag. However, if you choose that existing tag from the list of options instead of typing it out, the apostrophe gets encoded.
So my questions are:
Why is the tag encoded different depending on whether I choose it as an option or type it in?
How can I make it behave consistently for both cases, instead of encoding in one case and not encoding in another?
Many thanks if anyone has the answer to this as it has been puzzling me!