Home php教程 php手册 iconv() [function.iconv]: Detected an illegal character in

iconv() [function.iconv]: Detected an illegal character in

Jun 13, 2016 am 09:57 AM
character iconv article

本文章来给大家介绍iconv() [function.iconv]: Detected an illegal character in 错误的几种解决办法,有需要了解的朋友可参考。

用iconv函数将gb2312转换为utf-8时,怎么有些汉字会出现问题,像"??quot;字就会提示如下:
Notice: iconv() [function.iconv]: Detected an illegal character in input string

解决方法:

 代码如下 复制代码

iconv('UTF-8', 'GB2312//IGNORE', '??')
iconv('UTF-8', 'GBK', '??')

或者是编码不对,或者增加抑制符@

我们还可以使用其它方法操作

做一个GBK To UTF-8


mb_convert_encoding()使用详解

Php代码 

 代码如下 复制代码

header("content-Type: text/html; charset=Utf-8");
echo mb_convert_encoding("???S我的友仔", "UTF-8", "GBK");
?>


再来个GB2312 To Big5 
 

 代码如下 复制代码
header("content-Type: text/html; charset=big5");  
echo mb_convert_encoding("你是我的朋友", "big5", "GB2312");  
?> 
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How can I make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! How can I make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! Mar 15, 2024 pm 04:13 PM

1. How can you make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! 1. Activate basic rights and interests: original articles can earn profits by advertising, and videos must be original in horizontal screen mode to earn profits. 2. Activate the rights of 100 fans: if the number of fans reaches 100 fans or above, you can get profits from micro headlines, original Q&A creation and Q&A. 3. Insist on original works: Original works include articles, micro headlines, questions, etc., and are required to be more than 300 words. Please note that if illegally plagiarized works are published as original works, credit points will be deducted, and even any profits will be deducted. 4. Verticality: When writing articles in professional fields, you cannot write articles across fields at will. You will not get appropriate recommendations, you will not be able to achieve the professionalism and refinement of your work, and it will be difficult to attract fans and readers. 5. Activity: high activity,

Recommended essential functions for Chinese processing: Detailed explanation of PHP iconv function Recommended essential functions for Chinese processing: Detailed explanation of PHP iconv function Jun 27, 2023 pm 02:04 PM

In the process of text processing, it is a common requirement to convert strings in different encoding formats. The iconv (InternationalizationConversion) function provided in the PHP language can meet this need very conveniently. This article will introduce the use of iconv function in detail from the following aspects: Definition of iconv function and introduction to common parameters Example demonstration: Convert GBK encoded string to UTF-8 encoded string Example demonstration: Convert UTF

Use java's Character.isDefined() function to determine whether a character is a defined character Use java's Character.isDefined() function to determine whether a character is a defined character Jul 25, 2023 am 10:33 AM

Use Java's Character.isDefined() function to determine whether a character is a defined character. In Java programming, sometimes you need to determine whether a character is a defined character. For convenience, Java provides the isDefined() function of the Character class, which can help us quickly determine whether a character is a defined character. This article explains how to use this function and provides some code examples. Character class represents a single character in Java

Java uses the isLetterOrDigit() function of the Character class to determine whether a character is a letter or number Java uses the isLetterOrDigit() function of the Character class to determine whether a character is a letter or number Jul 24, 2023 pm 02:45 PM

Java uses the isLetterOrDigit() function of the Character class to determine whether a character is a letter or number. In Java programming, we often need to perform some operations and judgments on characters. One of the common needs is to determine whether a character is a letter or a number. Java provides the isLetterOrDigit() function of the Character class to help us implement this function. The Character class is a wrapper class used to operate and judge characters.

Java documentation interpretation: Detailed explanation of the isAlphabetic() method of the Character class Java documentation interpretation: Detailed explanation of the isAlphabetic() method of the Character class Nov 04, 2023 am 10:05 AM

Interpretation of Java documentation: Detailed explanation of the isAlphabetic() method of the Character class 1. Overview In the Java Character class, the isAlphabetic() method is used to determine whether a given character is an alphabetic character. It returns a boolean value, true indicating that the given character is an alphabetic character, false indicating that the given character is not an alphabetic character. This article will provide a detailed analysis of the use and principle of this method, and provide code examples to help readers better understand

Use java's Character.isLetterOrDigit() function to determine whether a character is a letter or number Use java's Character.isLetterOrDigit() function to determine whether a character is a letter or number Jul 25, 2023 pm 04:22 PM

Use Java's Character.isLetterOrDigit() function to determine whether a character is a letter or number. In Java, we often need to determine whether a character is a letter or number. In order to simplify this process, Java provides a built-in function Character.isLetterOrDigit(), which can help us quickly complete this judgment. The Character.isLetterOrDigit() function accepts a character as a parameter

Introduction to iconv command under CentOS Introduction to iconv command under CentOS Dec 29, 2023 pm 07:52 PM

iconv-fencoding[-tencoding][inputfile]...[Function] Converts the contents of a given file from one encoding to another. [Description]-fencoding: Convert characters from encoding to encoding. -tencoding: Convert characters to encoding. -l: List the known set of encoded characters -ofile: Specify the output file -c: Ignore illegal characters in the output -s: Suppress warning messages, but not error messages --verbose: Display progress information -f and -t can The specified legal characters are listed in the command with the -l option. [Example]* List currently supported character encodings

Use java's Character.isUpperCase() function to determine whether a character is an uppercase letter Use java's Character.isUpperCase() function to determine whether a character is an uppercase letter Jul 25, 2023 pm 11:45 PM

Use java's Character.isUpperCase() function to determine whether a character is an uppercase letter. In Java programming, sometimes we need to determine whether a character is an uppercase letter. Fortunately, Java provides a very convenient way to achieve this function, which is to use the isUpperCase() function of the Character class. This article will introduce how to use this function to make judgments and illustrate it with code examples. First, we need to understand Chara

See all articles