为什么iconv把不识别的字符转换成0,该如何解决
为什么iconv把不识别的字符转换成0
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> <?php $str = "100┫面积"; $content=iconv("gb2312","utf-8//ignore",$str); echo $content; ?>
会输出 “1000面积”,ignore的意思不是忽略吗,怎么转换成0了?
如果用mb_convert_encoding()则会输出 “100?面积”
有没有好的方法处理
------解决方案--------------------
gb2312换成gbk
------解决方案--------------------
因为 gb2312 是gbk的子集。很多特殊字符gb2312不支持。而gbk支持。
------解决方案--------------------
GBK是gb2312的扩展版本,有很多在gb2312没有对应编码的字符,GBK都有。
就好像GBK是php5,gb2312是php4,向下兼容并有扩充。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Go language encoding analysis: UTF-8 and GBK comparison In the Go language, processing string encoding is one of the common tasks. Among them, UTF-8 and GBK are two commonly used character encoding methods. This article will conduct a detailed comparison between UTF-8 and GBK, discuss their differences and usage, and attach specific code examples. 1. Introduction to UTF-8 and GBK UTF-8: UTF-8 is a variable-length Unicode encoding method that can represent characters in almost all languages in the world. UTF-8

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

Detailed explanation of CSS content attributes: content, counter and quotesCSS (cascading style sheets) is an integral part of front-end development. It can help us beautify web pages and enhance user experience. In CSS, there are some special properties that can be used to control the display of text content, including content, counter, and quotes. This article explains these properties in detail and provides specific code examples. 1. content attribute content attribute

1. Right-click the start menu and click Run. 2. Press control and press Enter to open the control panel > Clock and region > Region > Management method > Update operating system region settings > Check "Beta version: Use UnicodeUTF-8 to ensure global language support".

This article will explain in detail about changing the character encoding vector in fonts in PHP. The editor thinks it is very practical, so I share it with you as a reference. I hope you can gain something after reading this article. Changing the character encoding in a string in PHP In PHP, the character encoding of a string determines how the characters are represented. To change the character encoding of a string, you can use the following steps: 1. Determine the current character encoding $encoding=mb_detect_encoding($string); This will return a string representing the current character encoding of the string, such as "UTF-8" or "ISO-8859-1". 2. Use mb_convert_encoding

In an interview with CNBC's Andrew Ross Sorkin, Microsoft AI CEO Mustafa Suleymanexpressed his understanding of web copyright law. Suleyman says that content that is accessible on the open web is "freeware," and anyone can copy it, reproduc

图片消失如何解决先是图片文件上传$file=$_FILES['userfile']; if(is_uploaded_file($file['tmp_name'])){$query=mysql_query("INSERT INTO gdb_banner(image_src ) VALUES ('images/{$file['name'

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。
