intl

PHP Spoofchecker class

跟風遠走 提交于 2019-12-07 07:31:15
问题 I'm reading through the PHP manual and came across the Spoofchecker class in the intl extension documentation pages. The methods in the class, their parameters, as well as the class itself are all fairly undocumented as of right now so I'm wondering what the purpose of it is. 回答1: The class is calling ICU' library so you may find more detail. There they say, Because Unicode contains such a large number of characters and incorporates the varied writing systems of the world, incorrect usage can

The requested PHP extension intl is missing from your system (SonataAdminBundle) in Symfony2

本小妞迷上赌 提交于 2019-12-06 20:14:14
问题 I try to install the sandbox but I get the following error from composer: Loading composer repositories with package information Installing dependencies from lock file Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for sonata-project/intl-bundle 2.1.0 -> satisfiable by sonata-project/intl-bundle 2.1.0.` - sonata-project/intl-bundle 2.1.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.` Problem 2

Posix and intl extension on windows

落花浮王杯 提交于 2019-12-06 00:31:54
When I installed Symfony2 sandbox and try to check requirements by check.php I had 2 problems. My server don't have posix and intl extensions. I'm using WampServer 2.1e (32 bits) on Windows 7 32bit so my versions of apache and php are: Apache 2.2.17 VC6 ThreadSafe Php 5.3.5 I was trying to apply intl extension from http://windows.php.net/downloads/releases/php-5.3.5-Win32-VC6-x86.zip but i have weird error in apache log: "Can't find extension in c:/wamp/..." I'm sure that extension is in correct directory and enabled in php.ini. With posix extension I have bigger problem. I can't find it at

PHP - support for multibyte safe regular expressions

隐身守侯 提交于 2019-12-06 00:12:53
PHP supports regular expressions in three ways : POSIX ERE , now removed in PHP 7+ PCRE which is a core component , but not always multibyte safe Multibyte String , which is not enabled by default Today the web is Unicode , and PHP is too since 5.6 because of i18n . While PHP itself is known to be abysmally bad in supporting Unicode, Intl provides access to the relieving ICU library . To avoid the long wait for UString and repetition (and memory) when doin' it right , I prefer Intl and leave out iconv , Multibyte String along with DateTime , and rewrite most of the SBCS string functions to be

AWS Lambda Node.js Full-ICU

女生的网名这么多〃 提交于 2019-12-05 21:16:33
I run node.js app localy with this command: $ node --icu-data-dir=node_modules/full-icu app.local.js How to specify icu-data-dir in AWS Lambda environment? Thanks You should set the NODE_ICU_DATA environment variable so that it points to a directory where the correct ICU .dat file can be found. If you install the full-icu package using the node version that matches the one used by your lambdas, you should automatically get the correct .dat file. E.g. when using the runtime nodejs10.x : npx -p node@10.x npm i full-icu This installs node_modules/full-icu/ , and you should see the file icudt62l

ResourceBundle returns NULL without any errors being raised

非 Y 不嫁゛ 提交于 2019-12-05 13:16:38
For internationalized data it would be great to work with the \ResourceBundle class from PHP's "intl" extension. I got the extension running (PHP 5.3.4; Windows) and created a .dat file using the ICU Data Library Customizer *, but I don't get the expected result from the resource bundle class. Now I do this $bundle = '/var/www/libs/icudt48l.dat'; $resource = new \ResourceBundle('en_US', $bundle, true); var_dump($resource, is_file($bundle)); //--> NULL, TRUE The problem is $resource returns NULL without any errors being raised. What's going on? *(Only the last two data sections were checked

Where can I find a list of IDs or rules for the PHP transliterator (Intl)?

我的梦境 提交于 2019-12-05 12:09:50
Transliterator::listIDs() will list IDs, but apparently it's not a complete list. In the example from this page , the ID looks like: Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower(); which is kind of weird, because IDs are supposed to be unique. This looks more like a rule, but it doesn't work if I pass it to the createFromRules method :) Anyway, I'm trying to remove any punctuation from the string, except dash ( - ), or characters from a specific list. Do you know if that's possible? Or is there some documentation that better explains the syntax for the

php常见扩展

拥有回忆 提交于 2019-12-05 09:51:06
#####php常用扩展安装 ######php扩展 扩展帮助信息 http://pecl.php.net/ ######fileinfo 1、下载的php版本中自带有 cd /path/php/ext/fileinfo phpize ./configure --with-php-config=/path/php/bin/php-config make make install 2、在peclphp.net/搜索下载安装 ######msgpack 在peclphp.net/搜索下载安装 注意:版本是否适合php的版本 wget "http://pecl.php.net/get/msgpack-0.5.7.tgz" tar zxf msgpack-0.5.7.tgz cd msgpack-0.5.7 /usr/local/php/bin/phpize ./configure --with-msgpack make make install 最后修改下php.ini文件 extension = "msgpack.so" #######imap php安装包内含有 安装依赖包 yum install -y libc-client-* cd /path/php/ext/fileinfo phpize ./configure --with-php-config=/path/php/bin

NumberFormatter::SPELLOUT spellout-ordinal in russian and italian

只谈情不闲聊 提交于 2019-12-04 19:25:35
问题 this code works for english, spanish and german ordninal numbers, but with russian or italian ordninal numbers it doesn't work. 'ru-RU' , 'it-IT' also don't work I get for example in russian for 2 -> два (this is the cardinal number) , but I want the ordinal number and this would be here 2 -> второй. I get for example in italian for 2 -> due (this is the cardinal number) , but I want the ordinal number and this would be here 2 -> secondo. Update: I found a solution with works in french, spain

PHP NumberFormatter and Currency, can't set precision

瘦欲@ 提交于 2019-12-04 16:24:11
问题 I want to set a precision of 0 when using the NumberFormatter PHP class (from Intl extension) with currency. However I've got some strange result. Here: $numberFormatter = new NumberFormatter('en-US', NumberFormatter::CURRENCY); $numberFormatter->setAttribute(NumberFormatter::FRACTION_DIGITS, 0); echo $numberFormatter->formatCurrency('45', 'USD'); It outputs $45 , which is what I want. However, if I change the currency to EUR with the same settings: echo $numberFormatter->formatCurrency('45',