Every so often, I face this issue where I end up resorting to a messy workaround. There must be a correct way to handle it though, as it's common to work with UK pound symbols.
The dilemma is this: when the user inputs a UK pound symbol (£) into a textfield in the CMS and clicks 'save', the form field value gets escaped using the JavaScript escape() function and submitted via a jQuery AJAX POST request. However, somewhere along the process, the pound symbol turns into a question mark (possibly due to incorrect character encoding).
I can't simply convert the symbol to its HTML entity before saving to the database because when the values are fetched for display on the website's frontend, they are HTML encoded (resulting in the entity being displayed as is).
To finally resolve this confusion, what is the proper course of action here?