Code sharing of online conversion tools for php Unicode encoding and decoding
The code is as follows:
Function unicode_encode ($ name)
{
$ Name = iconv ('utf-8', 'ucs-2', $ name );
$ Len = strlen ($ name );
$ Str = '';
For ($ I = 0; $ I {
$ C = $ name [$ I];
$ C2 = $ name [$ I + 1];
If (ord ($ c)> 0)
{// Two-byte text
$ Str. = '\ U '. base_convert (ord ($ c), 10, 16 ). str_pad (base_convert (ord ($ c2), 1
Code sharing of online conversion tools for php Unicode encoding and decoding
The code is as follows:
Function unicode_encode ($ name){$ Name = iconv ('utf-8', 'ucs-2', $ name );$ Len = strlen ($ name );$ Str = '';For ($ I = 0; $ I {$ C = $ name [$ I];$ C2 = $ name [$ I + 1];If (ord ($ c)> 0){// Two-byte text$ Str. = '\ U '. base_convert (ord ($ c), 10, 16 ). str_pad (base_convert (ord ($ c2), 10, 16),
TCP transmission: Use the socket service to implement a text converter, socket Text Converter
Reprinted please indicate the source, thank you: http://blog.csdn.net/harryweasley/article/details/45665291
I recently read a teaching video and learned socket programming. There is an example in which I feel that it is well
Phpunicode decoding tool (unicode Converter)
// Unicode decoding and conversion
Function unicode_encode ($ name)
{
$ Name = iconv ('utf-8', 'ucs-2', $ name );
$ Len = strlen ($ name );
$ Str = '';
For ($ I = 0; $ I
{
$ C = $ name [$ I];
$ C2 = $ name [$ I + 1];
If (ord ($ c)> 0)
Copy Code code as follows:
'//convert Chinese to Unicode
function urlencoding (Vstrin)
Dim i
Dim strreturn,thischr,innercode,hight8,low8
Strreturn = ""
For i = 1 to Len (Vstrin)
THISCHR = Mid (vstrin,i,1)
If Abs (ASC (THISCHR)) Strreturn = Strreturn THISCHR
Else
Innercode = ASC (THISCHR)
If Innercode Innercode = Innercode + h10000
End If
Hight8 = (Innercode and hff00) \ hff
Low8 = Innercode and hff
Strreturn = strreturn "%" H
Reading ANSI, Unicode, Unicode big endian, and UTF-8 text files by row in vc ansi Environment
1. Question proposal
The file class cstdiofile provided by MFC. One of the functions readstring implements row-based reading of files, but it cannot meet the needs of reading different types of text files by row. To solve thi
From: http://www.mouseos.com/win64/TEXT_T.html
For programming on Windows, strings are often used:
Text ()Macro
_ T ()Macro
These two macros are used to classify string constants. In the following code:
Lptstr lpstra =Text("Hello ");
Lptstr lpstrb =_ T("Hello ");
UseText ()And_ T ()The results are the same.
However, they represent two different programming styles:
Windows programming style
C/C ++
Copy Code code as follows:
'//convert Chinese to Unicode
function urlencoding (Vstrin)
Dim i
Dim strreturn,thischr,innercode,hight8,low8
Strreturn = ""
For i = 1 to Len (Vstrin)
THISCHR = Mid (vstrin,i,1)
If Abs (ASC (THISCHR)) Strreturn = Strreturn THISCHR
Else
Innercode = ASC (THISCHR)
If Innercode Innercode = Innercode + h10000
End If
Hight8 = (Innercode and hff00) \ hff
Low8 = Innercode and hff
Strreturn = strreturn "%" H
text often because some of the format is not garbled, text recovery converter How to use? We can refer to the Word Document garbled Repair Tool tutorial, to learn it.
How the text recovery converter uses the Word document garbled Repair Tool tutorial
The last parag
Word document is corrupted, and Word prompts the text recovery Converter to open the file how to do, today small make a detailed explanation of the solution, help everyone more skilled grasp word, below we will look at the specific content!
Computer Tutorials
Use of the text recovery converter
First open
This problem occurs today. The word is just closed and cannot be opened. The above prompt is displayed.
Solution:
Open a Word document
Then select file -- open -- Select Your corrupted word
Click the downward arrow on the right to open and select Open and repair,
Generally, it can be opened.
I opened it in this way.
Other reference solutions are as follows:
When you open a Word 2003 document, the system prompts: "word cannot read this document, and the document may be damaged. Pl
issue: Ensure that all Unicode strings have the same underlyingsolution: to solve the same text with many different representation problems, you should first unify the text as a canonical form, which can be done through the Unicodedata module,Unicodedata.normalize (string Specifies the specification used, string).In Unicode
more about Unicode characters, let's take a look at UCD.4.1.1 what is UCD
UCD is the abbreviation of Unicode Character Database. UCD consists of plain text or html files that describe the properties and internal relationships of Unicode characters. You can see the latest UCD version on the
Does Unicode text Baidu (search engine) recognize it? In order to solve the full-text search of MySQL, I converted Chinese characters in the article into Unicode-encoded text display, such as: amp; #37325; amp; #26032; amp; #24320; amp; #22987; -- the webpage can be disp
Does Unicode text Baidu (search engine) recognize it? In order to solve the full-text search of MySQL, I converted Chinese characters in the article into Unicode-encoded text display, such as: amp; #37325; amp; #26032; amp; #24320; amp; #22987; -- the webpage can be disp
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.