Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
451 views
in Technique[技术] by (71.8m points)

javascript - 如何使用JavaScript解码阿拉伯字符(仅客户端解决方案)(How to decode Arabic characters using JavaScript (Only client side solution))

I have this text:

(我有这段文字:)

var txt = 'u0633u0644u0627u0645'; // ????

and it means: ???? in Arabic.

(它的意思是:????阿拉伯语。)

I need a JavaScript function that will transform this: u0633??? to this: ???? for example:

(我需要一个JavaScript函数来将其转换为:u0633 \ u0644 \ u0627 \ u0645例如:????:)

function convert(str){
// code here that convert each letter to Arabic for example or another decode solution ...
return  new_str;
}

var txt = 'u0633u0644u0627u0645'; // ????

console.log( convert(txt ) ); // ????

I search for the problem here but all what I get was server side solutions like PHP encoding functions and MySQL connection encode and HTML meta encode (not work also).

(我在这里搜索问题,但是得到的只是服务器端解决方案,例如PHP编码功能,MySQL连接编码和HTML元编码(也无法使用)。)

  ask by max max translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...