mailto Encode Issue

"mailto" will open Outlook in Big5 and this will cause dirty codes.

Solution:

  1. Encode params using $.param()
  2. Convert UTF-8 to Big5
    (Download this plugin: https://code.google.com/p/utf8tobig5/)
  3. Replace "+" with "%20"

Example:

var email_params = {
	subject: 'Fiiser 推薦 you "' + item.title + '"', 
	body: 'Fiiser recommend you "' + item.title + '": ' + item.appurl
}
var url = 'mailto:[email protected]?' + $.param(email_params);
url = EncodedUTF8ToBig5(url);
url = url.replace(/\+/g, '%20');

$panel.find('.share_list .email').attr('href', url);

Reference: