Greasy Fork is available in English.

Discussions » Creation Requests

UTF8 convert

§
Posted: 09-12-2017

UTF8 convert

I am having issues on my site where if I need to manually edit posts that have UTF-8 converted to Windows-1252 (or ISO 8859-1) format. It ends up looking like this below.

Piéral instead of Piéral Guérini instead of Guérini Rémy instead of Rémy Barbulée instead of Barbulée María instead of María Saintève instead of Saintève Eugène instead of Eugène Une fille à la 'Cour des Miracles' instead of à la 'Cour des Miracles' Françoise instead of Françoise

I have tried to use a simple replace with regex but this does not work as regex does not see or can not interpret the coding as I write it.

Ideally I was wanting to use this page http://www.i18nqa.com/debug/utf8-debug.html as a basis of transforming the mistaken characters to their proper encoding.

Is JS capable of this?

§
Posted: 11-12-2017

.replace(/\u00C3\u02C6/ig, '\u00C8') // È .replace(/\u00C3\u2030/ig, '\u00C9') // É .replace(/\u00C3\u0160/ig, '\u00CA') // Ê

Figured out that I needed to go with this to get things to work.

Post reply

Sign in to post a reply.