cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. ET on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

怎样将特殊编码的字符转换为中文?

大家好!

我在网页下载得到的特殊编码的字符怎样用脚本转换为中文?

谢谢!

2022-05-04_21-10-45.png

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: 怎样将特殊编码的字符转换为中文?

Might have to do something fun like this with some escaping:

Names Default To Here(1);

input_str = "\u4e01\u516c\u85e4";

uni = "\[\!U]\";
quotationmark = "\!"";
converted_str = Eval(Parse(quotationmark||Substitute(input_str, "\u", uni)||quotationmark));
Show(converted_str);

There might (or might not) be easier way to do this, this idea is from +Re: Column Formula to convert Unicode to symbol  by @Craige_Hales 

-Jarmo

View solution in original post

5 REPLIES 5
lala
Level IX

Re: 怎样将特殊编码的字符转换为中文?

The JSL command automatically converts.

d1=jsontodatatable(txt);
lala
Level IX

Re: 怎样将特殊编码的字符转换为中文?

  • But how do  convert them individually? For example,

\u4e01\u516c\u85e4
\u4e01\u516c\u85e4 →丁公藤
jthi
Super User

Re: 怎样将特殊编码的字符转换为中文?

Try adding ! after \

jthi_0-1651672293106.png

You can find this info from JMP Scripting Guide and search for Unicode Characters or from unicode characters (jmp.com) 

 

-Jarmo
lala
Level IX

Re: 怎样将特殊编码的字符转换为中文?

谢谢、我还是没有明白如何用脚本将它转换得到中文。

jthi
Super User

Re: 怎样将特殊编码的字符转换为中文?

Might have to do something fun like this with some escaping:

Names Default To Here(1);

input_str = "\u4e01\u516c\u85e4";

uni = "\[\!U]\";
quotationmark = "\!"";
converted_str = Eval(Parse(quotationmark||Substitute(input_str, "\u", uni)||quotationmark));
Show(converted_str);

There might (or might not) be easier way to do this, this idea is from +Re: Column Formula to convert Unicode to symbol  by @Craige_Hales 

-Jarmo

Recommended Articles