Foreword recently, because of project needs, need to read a TXT document containing Chinese, and then save the file. The document was previously encoded by Base64, resulting in garbled reading of all Chinese characters. After the project team abandoned Base64, there were two errors: ASCII codec can ' t encode characters in position ordinal not in range 128UnicodeDecodeError: ' UTF8 ' Codec can ' t decode byte 0x. If you are not familiar with ASCII, Unicode, and utf-8, you can look at the previous article about strings and encodings you must understand the following three concepts: ASCII can only represent numbers, English letters, and some
1. Recommended 10 articles for PHP pre-defined constants E_error
Introduction: Foreword Recently, because of project needs, need to read a TXT document containing Chinese, and then save the file. The document was previously encoded by Base64, resulting in garbled reading of all Chinese characters. After the project team abandoned the Base64, there were two errors:ascii codec can& #39;t encode characters& Nbsp;in position ordinal not in ...
2. Python solves Chinese character coding problem: Unicode Decode Error_python
Introduction: Recently in the use of Python to read a document containing Chinese characters, resulting in garbled, and reported two errors, helpless can only search the Internet to find the answer, after the help of the netizen to solve the problem, think about summarizing, the following article mainly introduces how Python solves Chinese character coding problem, Friends who need it can be used for reference.
3. Apache environment, localhost has been loading, but 127.0.0.1 can be accessed normally
Description: Apache environment localhost:82 problem: Browser input localhost:82, no response (all normal yesterday), but 127.0.0.1:82 can access the situation: 1. The error log is as follows Apache Error.log httpd.conf Red Pen is the place I have changed the Hosts file as follows {generation ...
4. PHP pthreads using mutex when CLI has stop
Summary: pthreads when using mutex locking, the CLI crashes (WIN7) code: {Code ...} If you can tell me where the PHP system log can be (similar to Apache's Error.log). To add: According to the official pthreads is thread-safe, theoretically thread-safe itself ...
5. Local XAMPP operating environment, browser access to the local environment appears Err_connection_reset
Introduction: Local layout of an environment, Apache PHP Run no problem. Echo phpinfo () Pboard.png] (/IMG/BVF2CF) but cannot open when opening the local site environment: Why is the SSL module open in XAMPP? Apache errorlog ah00112:warning:d ...
6. Error explanation in PHP $_file
Introduction: When uploading files with PHP, we will use the program to listen to the browser sent over the file information, the first will be $_files[fieldname][' error ' of the different values to determine whether the file status is normal. $_files[fieldname] [' ERROR ']==0 stands for all normal, the other values of the specific meaning please refer to the following paragraph of the program's comments section! Switch ($_files[$field [' ERROR ']) {Case 1 ...
7. Php--require/include/require_once/include_once
Summary: Require and include are almost exactly the same, in addition to handling failures in a different way. Require generates an E_COMPILE_ERROR level error when an error occurs, in other words, causes the script to abort and the include only generates a warning (e_warning), and the script continues to run.
8. PHP namespace Error
Description: Error parse Error:syntax error, unexpected t_string in f:appwampserverappservwwwnamespace.php on line 3 {code ...}
9. Smarty-where is this PHP error? I didn't find anything wrong.
Description: This is the section code of the Smarty set for the online search. First hint of parse Error:syntax error, unexpected t_constant_encapsed_string in f:phpstudywwwsmartysconfig.php on line 2 I see the second line no problem ah, so I knocked again, a ...
10. What is the error in this PHP section? I didn't find anything wrong.
Description: This is the section code of the Smarty set for the online search. First hint of parse Error:syntax error, unexpected t_constant_encapsed_string in f:phpstudywwwsmartysconfig.php on line 2 I see the second line no problem ah, so I knocked again, a ...
"Related question and answer recommendation":
Objective-c-AFN POST request code=-1011 "Failed:internal Server error (500)" "
PHP-A little doubt about the include ()
Php-apache environment, localhost is always loaded, but 127.0.0.1 can be accessed normally
Javascript-node query mysql times wrong er_parse_error
PHP-Why does this always prompt for errors?