TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Manoj Maharana
NA
362
128.6k
function for Base64Decode unable to decode the character €
May 20 2019 8:27 AM
UTF8 Decode for € not working with the below method.
What changes needed to decode in UTF8 For Euro symbol (€). I have tried the escape method before decodeuricomponent. what changes need in the method with out use of escape???
var Base64Decode = function (encoded, escapeChar) {
try
{
var keyStr =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
;
//èéêëàâùìîçò";
var output =
""
;
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
do
{
enc1 = keyStr.indexOf(encoded.charAt(i++));
enc2 = keyStr.indexOf(encoded.charAt(i++));
enc3 = keyStr.indexOf(encoded.charAt(i++));
enc4 = keyStr.indexOf(encoded.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if
(enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if
(enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
}
while
(i < encoded.length);
if
(escapeChar == undefined) {
return
decodeURIComponent(output);
}
else
{
return
output;
}
}
catch
(ex) {
}
};
The output comes like â¬
Reply
Answers (
0
)
validation in excel sheet !
What is difference between proxy and reverse proxy server?