开发者

Handle special characters in ASCII

My Javascript function returns a char arrya which might contain non-printable 开发者_Python百科characters. In fact each character is a byte (represented as a number from 0-255). The problem is that when I try to copy this char array to the notepad, for example, I get these results:

ORIGINAL STRING IN JAVASCRIPT:

performance of thisĎask, ćd so modest hā conductėďaĤĦĞaġ proposalĒČĵrriageėġclaŅngĥimselfėĔĘ furďħiīĭemenį willŢőtĝĶĻijħĜnėwhoėĴĔŕşedŹoulĚbeĩŦśŌevħĆŸ ičĴwāĊcŎeŝŭy bĺughĤup. TĦƠƘrĊĆńiƂ;ĨƜƞĨƆtivIJiĪ ŅĀnƂĎĴtĿŧtĒźich nIJŞĊhĶơĢűƘƃĘī MŖĢiňDžĒĜǁsŞpſdžĐǧǐooŗŖlowĒŢ

STRING PASTED TO NOTEPAD:

performance of this?ask, ?d so modest h? conduct??a???a? proposal???rriage??cla?ng?imself??? fur??i??emen? will??t??????n?who?????ed?oul?be????ev??Ÿ i??w??c?e??y b?ugh?up. T???r???i?;?????tiv?i? ??n???t??t??ich n???h???????? M??i?????s?p?????oo??low??

What can I do to have this string properly represented on Notepad when pasting it? On my HTML I am using UTF-8.

THANKS


Try telling notepad to use UTF-8. Save a blank file making the Encoding (last parameter at the bottom of the save dialog) UTF-8.

Note that I am able to copy the UTF-8 out of the page into notepad, maybe you have an encoding problem in your javascript file?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜