Home Backend Development PHP Tutorial 关于百度贴吧编码有关问题

关于百度贴吧编码有关问题

Jun 13, 2016 pm 01:25 PM
gbk urlencode

关于百度贴吧编码问题
我异想天开的以为百度的搜索和贴吧走的一个编码,可能是一个吧,但是对于@人的这个功能,被@的ID确不能使用这个编码,也就是utf-8编码,下面举个例子说一下:
百度搜索引擎里面wd=后面的是搜索词的编码,我如果要搜索“贴吧楼委会”,那么就是%E8%B4%B4%E5%90%A7%E6%A5%BC%E5%A7%94%E4%BC%9A
但是在贴吧里面的帖子@%E8%B4%B4%E5%90%A7%E6%A5%BC%E5%A7%94%E4%BC%9A并不会连接到贴吧楼委会这个ID上面去,我查看了一下链接,也就是http://tieba.baidu.com/i/sys/jump?un=%CC%F9%B0%C9%C2%A5%CE%AF%BB%E1,很明显编码成为了un=后面的一大串,我试了好几个编码都没有合适的,所以想到这里问问各位有没有知道的?或者说是百度内部的编码?谢谢了~

------解决方案--------------------
echo urlencode(iconv('utf-8','gbk','贴吧楼委会'));

%CC%F9%B0%C9%C2%A5%CE%AF%BB%E1


------解决方案--------------------
经验证,这就是gbk码的:贴吧楼委会 编码后的结果。

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 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 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)

Go language encoding analysis: UTF-8 and GBK comparison Go language encoding analysis: UTF-8 and GBK comparison Mar 28, 2024 pm 01:54 PM

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's urlencode() function: How to encode a string into a URL-safe format PHP's urlencode() function: How to encode a string into a URL-safe format Nov 03, 2023 pm 12:39 PM

PHP's urlencode() function: How to encode a string into a URL-safe format, specific code examples are needed. With the development of the Internet, URLs are widely used in daily life, and we often need to encode strings with some special characters into URL-safe formats. Format to pass parameters in the URL or request a web page. PHP provides the urlencode() function to accomplish this task. This article will introduce the usage of urlencode() function and give some specific code examples. 1. ur

How to use urlencode function to encode URL in PHP How to use urlencode function to encode URL in PHP Jun 26, 2023 pm 12:48 PM

In modern development, passing data through URLs is a common way. However, because the URL may contain some special characters, such as spaces, slashes, and question marks, these special characters will destroy the structure of the URL and cause data transmission to fail. In order to avoid this situation, PHP provides the urlencode function, which can encode the URL into a transportable format. The use of the urlencode function is very simple. Its syntax is as follows: stringurlencode(string

Introduction to PHP functions—urlencode(): encode URLs Introduction to PHP functions—urlencode(): encode URLs Jul 25, 2023 pm 09:25 PM

Introduction to PHP functions—urlencode(): Encoding URLs When developing web applications, you often encounter situations where URLs need to be encoded. URL encoding ensures that special characters in URLs are passed correctly, avoiding problems or incorrect results. In PHP, we can use the urlencode() function to perform URL encoding. The function of urlencode() function is to convert the string into an encoding format that conforms to the URL specification. It converts non-alphanumeric characters in a string to

How to use urlencode function How to use urlencode function Nov 15, 2023 am 11:45 AM

Usage: 1. Used to encode dictionary; 2. Used to encode list; 3. Used to encode nested list; 4. Specify separator, etc.

How to use the urllib.urlencode() function to encode parameters in Python 2.x How to use the urllib.urlencode() function to encode parameters in Python 2.x Jul 29, 2023 pm 12:57 PM

How to use the urllib.urlencode() function to encode parameters in Python2.x During the programming process, we often need to interact with the server and pass parameters. In the process of passing parameters, we need to properly encode the parameters to ensure the correct transmission and parsing of data. Python provides the urllib library, in which the urlencode() function is a tool used to encode parameters. Let's take a look at Python2.x

How to use the urlencode function to encode special characters in PHP How to use the urlencode function to encode special characters in PHP Jun 26, 2023 pm 04:09 PM

In PHP, we often need to encode special characters in the URL in order to pass parameters correctly. At this time, you can use the urlencode function. The function of the urlencode function is to encode special characters in the string so that they can be passed in the URL. These special characters include: alphanumeric characters, punctuation marks, protocol characters, some reserved characters, etc. The following is the basic syntax of the urlencode function: urlencode(string$str):str

PHP change character encoding vector in font PHP change character encoding vector in font Mar 21, 2024 pm 03:11 PM

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

See all articles