SethClydesdale / forumactif-edge

A free modern and responsive forum theme for Forumotion forums.
https://sethclydesdale.github.io/forumactif-edge/
GNU General Public License v3.0
10 stars 17 forks source link

windows-1252 characters become corrupted over AJAX #35

Closed SethClydesdale closed 7 years ago

SethClydesdale commented 7 years ago

Topic on the forum : http://fmdesign.forumotion.com/t1302-upgraded-characters-updated#29858

Description : Accented and special characters appear to become corrupted when transferred over AJAX on older charsets like window-1252. I've dealt with this issue before and already have a fix ready, we just need to implement it into the control panel's AJAX functions. The code in question is :

function Encode (string) {
  return encodeURIComponent(escape(string).replace(/%u[A-F0-9]{4}/g, function(match) {
    return '&#' + parseInt(match.substr(2), 16) + ';'
  })).replace(/%25/g, '%')
};

It has been awhile since I've worked with this, so I'll need to refresh my memory on what needs to be done. Until this has been implemented any further patches are on hold as to avoid corrupting the characters of older forums using FAE.

SethClydesdale commented 7 years ago

Thanks to Milouze14 having helped in testing the new Encoder, we've successfully fixed the issue of special characters becoming corrupted on non-utf8 forums. This update is currently live for all non-utf8 forums ; if there are any problems do not hesitate to open a new issue ! 😉