10th
APR

神奇文字(菊花文)实现原理及Demo

Posted by JCLee under 技术

最近发现一种神奇的文字,菊花文,在腾讯微博里炒的很凶。

发现这种文字很神奇:神҉奇҉文҉字҉(҉含҉菊҉花҉文҉)҉转҉换҉工҉具҉

就研发了一下,发现实现原理超级简单,其实是将正常汉字+一个特殊码组成的。

js实现代码如下:

var code = String.fromCharCode(1161); //这就是加入的特殊编码
var outputStr = '';
for(var i=0,l=inputStr.length; i<l; i++){   //将输入的正常文字进行循环插入特殊编码
outputStr += inputStr.charAt(i) + code;
}

原理超级简单,但效果很神奇。我就叫这种文字为神奇文,我又加入了边框等特殊字符。同样的原理还可以加入其它的字符。

看一下我昨晚做的简单转换工具吧。

猜测您可以感兴趣的内容:

  • 抱歉,没有您更多感兴趣的内容。

Reader's Comments

  1. linki sponsorowane |

    I think other web-site proprietors should take this website as an model, very clean and magnificent user friendly style and design, as well as the content. You’re an expert in this topic!

  2. adult video on demand |

    I dont mind sitting within my notebook as well as doing nothing but becoming surprised about how great and fantastic this web site of yours is. There has no other website that will keep me glued for a time other than yours. Please continue the good work!

  3. adult video on demand |

    Just like my employer, I rarely express great job to a good something, however nowadays after stumbling directly into the doorsteps of the web site, I can claim you probably did a terrific work! I ain’t your manager.

Leave a Reply


Spam Protection by WP-SpamFree

This site is protected by WP-CopyRightPro