Comments (8)
The "//ignore" option doesn't work with recent versions of the iconv library. So if you're having trouble with that option, you aren't alone.
That means you can't currently use this function to filter invalid characters. Instead it silently fails and returns an empty string (or you'll get a notice but only if you have E_NOTICE enabled).
This has been a known bug with a known solution for at least since 2009 years but no one seems to be willing to fix it (PHP must pass the -c option to iconv). It's still broken as of the latest release 5.4.3.
https://bugs.php.net/bug.php?id=48147
https://bugs.php.net/bug.php?id=52211
https://bugs.php.net/bug.php?id=61484
[UPDATE 15-JUN-2012]
Here's a workaround...
ini_set('mbstring.substitute_character', "none");
$text= mb_convert_encoding($text, 'UTF-8', 'UTF-8');
That will strip invalid characters from UTF-8 strings (so that you can insert it into a database, etc.). Instead of "none" you can also use the value 32 if you want it to insert spaces in place of the invalid characters.
from aliyun-oss-php-sdk.
docker-library/php#240 如果使用了alpine系统,libiconv的版本会很低,需要更新一下 libiconv的版本
在dockerfile中添加如下命令更新
RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
from aliyun-oss-php-sdk.
现在应该是这样:
# testing -> community
RUN apk add --no-cache --repository http://mirrors.aliyun.com/alpine/edge/community gnu-libiconv
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
from aliyun-oss-php-sdk.
是Bug吗?还是我环境有问题?
from aliyun-oss-php-sdk.
http://php.net/manual/zh/function.iconv.php#108643
from aliyun-oss-php-sdk.
just remove the //IGNORE,
$options[self::OSS_OBJECT] = iconv('GBK', "UTF-8", $options[self::OSS_OBJECT]);
from aliyun-oss-php-sdk.
docker-library/php#240 如果使用了alpine系统,libiconv的版本会很低,需要更新一下 libiconv的版本
在dockerfile中添加如下命令更新
RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
docker for windows 中怎么打开dockerfile文件呢?
from aliyun-oss-php-sdk.
from aliyun-oss-php-sdk.
Related Issues (20)
- BUG HOT 1
- 错误的返回声明 HOT 1
- GetBucketV2 (ListObjectsV2)请尽快实现 HOT 1
- 请尽快支持 开启加速 BucketTransferAcceleration HOT 1
- laravel aliyuncs/oss-php-sdk Large file upload HOT 2
- 没有返回 x-oss-request-id
- 个人建议
- 简单上传:上传成功后,地址可以访问但都是空白
- File size 0
- 获取大文件时,SDK报错
- getObject等方法如何获取返回的header信息
- signUrl方法 options 指定Content-Type后提示签名错误 HOT 1
- sdk can not composer HOT 1
- RequestCoreException: cURL error: Empty reply from server (52)
- Call to undefined function OSS\Http\set_time_limit()
- 希望增加对异步处理(x-oss-async-process)的支持 HOT 1
- php8.1报错.strlen(): Passing null to parameter #1 ($string) of type string is deprecated HOT 5
- 8.0以上PHP版本null值报错 HOT 3
- signUrl bug HOT 1
- LiveChannel设置 playListName 无效 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliyun-oss-php-sdk.