📄 unicode-test.js
字号:
// Copyright 2008 the V8 project authors. All rights reserved.// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions are// met://// * Redistributions of source code must retain the above copyright// notice, this list of conditions and the following disclaimer.// * Redistributions in binary form must reproduce the above// copyright notice, this list of conditions and the following// disclaimer in the documentation and/or other materials provided// with the distribution.// * Neither the name of Google Inc. nor the names of its// contributors may be used to endorse or promote products derived// from this software without specific prior written permission.//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.// Texts are from the Unibrow test suite.// Note that this file is in UTF-8. smjs and testkjs do not read their// source files as UTF-8, so they will fail on this test. If you want// to run the test on them you can do so after filtering it with the// following piece of perl-based line noise:// perl -CIO -ne '$_ =~ s/([^\n -~])/"\\u" . sprintf("%04x", ord($1))/ge; print $_;' < unicode-test.js > unicode-test-ascii.js// The result is predictably illegible even for those fluent in Hindi.var chinese ="中国历史\n" +"[编辑首段]维基百科,自由的百科全书\n" +"跳转到: 导航, 搜索\n" +"中國歷史\n" +"中国历史系列条目\n" +"史前时期\n" +"传说时期\n" +"(另见三皇五帝)\n" +"夏\n" +"商\n" +"西周 周\n" +"春秋 东周\n" +"战国\n" +"秦\n" +"西汉 汉\n" +"新朝\n" +"东汉\n" +"魏 蜀 吴 三\n" +"国\n" +"西晋 晋\n" +"东晋 十六国\n" +"宋 南\n" +"朝 北魏 北\n" +"朝 南\n" +"北\n" +"朝\n" +"齐\n" +"梁 东\n" +"魏 西\n" +"魏\n" +"陈 北\n" +"齐 北\n" +"周\n" +"隋\n" +"唐\n" +"(另见武周)\n" +"五代十国\n" +"辽\n" +"(西辽) 西\n" +"夏 北宋 宋\n" +"金 南宋\n" +"元\n" +"明\n" +"清\n" +"中华民国\n" +"中华人民\n" +"共和国 中华\n" +"民国\n" +"(见台湾问题)\n" +"\n" +" * 中国历史年表\n" +" * 中国军事史\n" +" * 中国美术史\n" +" * 中国科学技术史\n" +" * 中国教育史\n" +"\n" +"中国\n" +"天坛\n" +"文化\n" +"中文 - 文学 - 哲学 - 教育\n" +"艺术 - 国画 - 戏曲 - 音乐\n" +"神话 - 宗教 - 术数 - 建筑\n" +"文物 - 电影 - 服饰 - 饮食\n" +"武术 - 书法 - 节日 - 姓名\n" +"地理\n" +"疆域 - 行政区划 - 城市\n" +"地图 - 旅游 - 环境 - 生物\n" +"人口 - 民族 - 交通 - 时区\n" +"历史\n" +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -