<?php
/**
* MultibyteTest file
*
* PHP versions 4 and 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The Open Group Test Suite License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.6833
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
App::import('Core', 'Multibyte');
/**
* MultibyteTest class
*
* @package cake
* @subpackage cake.tests.cases.libs
*/
class MultibyteTest extends CakeTestCase {
/**
* testUtf8 method
*
* @access public
* @return void
*/
function testUtf8() {
$string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
$result = Multibyte::utf8($string);
$expected = array(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126);
$this->assertEqual($result, $expected);
$string = '¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈ';
$result = Multibyte::utf8($string);
$expected = array(161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200);
$this->assertEqual($result, $expected);
$string = 'ÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬ';
$result = Multibyte::utf8($string);
$expected = array(201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,
243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263,
264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300);
$this->assertEqual($result, $expected);
$string = 'ĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐ';
$result = Multibyte::utf8($string);
$expected = array(301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342,
343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363,
364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400);
$this->assertEqual($result, $expected);
$string = 'ƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃDŽDždžLJLjljNJNjnjǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZDzdzǴ';
$result = Multibyte::utf8($string);
$expected = array(401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421,
422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442,
443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463,
464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484,
485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500);
$this->assertEqual($result, $expected);
$string = 'əɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʘʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯʰʱʲʳʴʵʶʷʸʹʺʻʼ';
$result = Multibyte::utf8($string);
$expected = array(601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621,
622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642,
643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663,
664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684,
685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700);
$this->assertEqual($result, $expected);
$string = 'ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛ';
$result = Multibyte::utf8($string);
$expected = array(1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041,
1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051);
$this->assertEqual($result, $expected);
$string = 'МНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыь';
$result = Multibyte::utf8($string);
$expected = array(1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069,
1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087,
1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100);
$this->assertEqual($result, $expected);
$string = 'չպջռսվտ';
$result = Multibyte::utf8($string);
$expected = array(1401, 1402, 1403, 1404, 1405, 1406, 1407);
$this->assertEqual($result, $expected);
$string = 'فقكلمنهوىيًٌٍَُ';
$result = Multibyte::utf8($string);
$expected = array(1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615);
$this->assertEqual($result, $expected);
$string = '✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿❀❁❂❃❄❅❆❇❈❉❊❋❌❍❎❏❐❑❒❓❔❕❖❗❘❙❚❛❜❝❞';
$result = Multibyte::utf8($string);
$expected = array(10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040, 10041, 10042, 10043, 10044,
10045, 10046, 10047, 10048, 10049, 10050, 10051, 10052, 10053, 10054, 10055, 10056, 10057,
10058, 10059, 10060, 10061, 10062, 10063, 10064, 10065, 10066, 10067, 10068, 10069, 10070,
10071, 10072, 10073, 10074, 10075, 10076, 10077, 10078);
$this->assertEqual($result, $expected);
$string = '⺀⺁⺂⺃⺄⺅⺆⺇⺈⺉⺊⺋⺌⺍⺎⺏⺐⺑⺒⺓⺔⺕⺖⺗⺘⺙⺛⺜⺝⺞⺟⺠⺡⺢⺣⺤⺥⺦⺧⺨⺩⺪⺫⺬⺭⺮⺯⺰⺱⺲⺳⺴⺵⺶⺷⺸⺹⺺⺻⺼⺽⺾⺿⻀⻁⻂⻃⻄⻅⻆⻇⻈⻉⻊⻋⻌⻍⻎⻏⻐⻑⻒⻓⻔⻕⻖⻗⻘⻙⻚⻛⻜⻝⻞⻟⻠';
$result = Multibyte::utf8($string);
$expected = array(11904, 11905, 11906, 11907, 11908, 11909, 11910, 11911, 11912, 11913, 11914, 11915, 11916, 11917, 11918, 11919,
11920, 11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11931, 11932, 11933, 11934, 11935, 11936,
11937, 11938, 11939, 11940, 11941, 11942, 11943, 11944, 11945, 11
没有合适的资源?快使用搜索试试~ 我知道了~
cakephp1.3.11
需积分: 3 11 下载量 166 浏览量
2011-08-11
22:05:55
上传
评论
收藏 961KB GZ 举报
温馨提示
共771个文件
php:462个
ctp:103个
empty:78个
cakephp php 借鉴raid on ralis的php实现,目前最稳定版。
资源推荐
资源详情
资源评论
收起资源包目录
cakephp1.3.11 (771个子文件)
cake.bat 1013B
cake 849B
cake.generic.css 9KB
cake.generic.css 9KB
webroot_test.css 39B
test_plugin_asset.css 38B
theme_webroot.css 35B
test_asset.css 31B
test_asset.css 31B
theme_webroot.css 22B
home.ctp 7KB
view.ctp 7KB
view.ctp 6KB
controller_actions.ctp 6KB
test_nocache_tags.ctp 5KB
model.ctp 5KB
index.ctp 4KB
index.ctp 4KB
home.ctp 3KB
form.ctp 3KB
home.ctp 2KB
sql_dump.ctp 2KB
edit.ctp 2KB
default.ctp 2KB
default.ctp 2KB
default.ctp 2KB
test.ctp 2KB
missing_action.ctp 2KB
controller.ctp 2KB
missing_component_class.ctp 1KB
multi_cache.ctp 1KB
missing_controller.ctp 1KB
missing_behavior_file.ctp 1KB
missing_helper_file.ctp 1KB
missing_model.ctp 1KB
missing_behavior_class.ctp 1KB
missing_component_file.ctp 1KB
missing_helper_class.ctp 1KB
flash.ctp 1KB
flash.ctp 1KB
flash.ctp 1KB
missing_view.ctp 1KB
missing_layout.ctp 1KB
missing_connection.ctp 1KB
fixture.ctp 1KB
missing_scaffolddb.ctp 1KB
private_action.ctp 1KB
missing_table.ctp 1KB
scaffold_error.ctp 1KB
default.ctp 946B
default.ctp 946B
default.ctp 944B
thin.ctp 913B
custom.ctp 905B
cache_layout.ctp 903B
custom.ctp 891B
error404.ctp 877B
error500.ctp 855B
default.ctp 796B
default.ctp 794B
default.ctp 793B
default.ctp 781B
wide.ctp 781B
default.ctp 780B
default.ctp 780B
sequencial_nocache.ctp 774B
ajax2.ctp 770B
default.ctp 700B
default.ctp 700B
default.ctp 700B
ajax.ctp 699B
ajax.ctp 699B
ajax.ctp 699B
cache_empty_sections.ctp 495B
extract.ctp 485B
cache_form.ctp 319B
default.ctp 255B
default.ctp 238B
default.ctp 238B
multiple_nocache.ctp 234B
sub1.ctp 178B
nocache_multiple_element.ctp 151B
contains_nocache.ctp 147B
session_helper.ctp 131B
sub2.ctp 131B
default.ctp 109B
default.ctp 109B
default.ctp 109B
plain.ctp 91B
nested_element.ctp 81B
test_plugin_element.ctp 72B
default.ctp 70B
default.ctp 64B
default.ctp 64B
plugin_element.ctp 64B
helper_overwrite.ctp 63B
html_call.ctp 62B
cache_empty_sections.ctp 60B
plugin_default.ctp 44B
index.ctp 42B
共 771 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
任笑
- 粉丝: 7
- 资源: 68
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- AIS2024 valid
- 最入门的爬虫代码 python.docx
- 爬虫零基础入门-爬取天气预报.pdf
- 最通俗易懂的 MongoDB 非结构化文档存储数据库教程.zip
- 以mongodb为数据库的订单物流小项目.zip
- 腾讯云-mongodb数据库, 项目部署.zip
- 腾讯 APIJSON 的 MongoDB 数据库插件.zip
- 理解非关系型数据库和关系型数据库的区别.zip
- 操作简单的Mongodb网页web管理工具,基于Spring Boot2.0支持mongodb集群.zip
- tms-mongodb-web,提供访问mongodb数据的REST API和可灵活扩展的mongodb web 客户端.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功