Skip to content

Instantly share code, notes, and snippets.

View nhduong29's full-sized avatar

Duong Nguyen nhduong29

  • Averis Sdn Bhd
  • Kuala Lumpur - Malaysia
View GitHub Profile
@wenzhixin
wenzhixin / jquery.base64.js
Created October 29, 2014 02:28
Base64 plugin support unicode characters.
jQuery.base64 = (function($) {
// private property
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
// private method for UTF-8 encoding
function utf8Encode(string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {