When the front-end input is in Chinese, the backend post is via String text = Getrequest (). GetParameter ("text");But there's a problem with GET,The Get method submits the parameter encoding, which only supports iso8859-1 encoding.So if there is Chinese in it.In the background you need to convert the code, as followsString text= request.getparameter ("text");Text = new String (text.getbytes ("iso8859-1"), "GBK");The premise is that your page encoding is GBK, if it is utf-8, then the above code
Let's not say much about it. the function is used to check and transcode strings. For more information, see UTF-8 encoding. However, if the other blog uses gb2312 encoding, garbled characters will appear after the POST (unless the encoding is converted before the POST ). It is necessary to perform an encoding check and conversion on your own without ensuring that the other party must use UTF-8 encoding.
I wrote a function to complete this operation. The principle is very simple. because gb2312/
Php code-to-code: import data from oracle to mysql. the data section in oracle displays Incorrectstringvalue: xE6xBBx9AxE5x8AxA8... forcolumnintroatrow1 during insertion. How can we implement effective encoding conversion? such iconv and mb_convert... all require character parameters. Mb_detect php transcoding
Import data from oracle to mysql. the data section in oracle shows the Incorrect string value: '\ xE6 \ xBB \ x9A \ xE5 \ x8A \ xa8... for col
Php Chinese url transcoding
For URL encoding in PHP, urlencode () or rawurlencode () can be used. The difference between the two is that the former encodes spaces into '+ ', the latter encodes spaces into '% 20', but it should be noted that only part of the URL should be encoded, otherwise the colon and backslash in the URL will be escaped. The following is a detailed explanation:String urlencode (string str) Returns a string -_. all
Using System.Web; Reference system.web.TextBox2.Text = System.Web.HttpUtility.UrlDecode (TextBox1.Text, System.Text.Encoding.GetEncoding ("GB2312"));// Convert the encoding in the URL to a simplified Chinese characterTextBox2.Text = System.Web.HttpUtility.UrlEncode (TextBox1.Text, System.Text.Encoding.GetEncoding ("GB2312"));// Convert a simplified Chinese character to a URL encodingTextBox2.Text = System.Web.HttpUtility.UrlDecode (TextBox1.Text, System.Text.Encoding.GetEncoding ("BIG5"));// Con
FFmpeg/avconv MPEG2-related transcoding parameters for radio and television
Avconv-I source. ts-R 25-aspect-s 720*576-muxrate 3800 K-C: V mpeg2video-flags ildct + ilme-top 0-B: V 3500 K-minrate: V 3500 K-maxrate: V 3500 K-bufsize 1000 K-streamid 0: 512-C: A MP2-B: A 192 K-streamid-ar 44100-F mpegts-y output. TS
-Muxrate: Repeat the bit rate. The overall bit rate mode is CBR.
-C: V mpeg2video MPEG2 Video Encoding
-Flags ildct + ilme Line Scan
New hand conversion code question: urltest.txt; $ read nbsp; fopen ($ url, r) nbsp; or nbsp; die (opening failed); $ textfread ($ read, 100 ); fclose ($ read); echo nbsp; iconv (UTF-8, GBK, this is a test ). lt; br gt; # new-user transcoding problems
Using urlpolic'test.txt ';$ Read = fopen ($ url, 'r') or die ('open failed ');$ Text = fread ($ read, 100 );Fclose ($ read );Echo iconv ('utf-8', 'gbk', 'This is a test ').''; # This sentence is
Mb_convert_encoding (Addslashes ($u [+]), ' UTF-8 ', ' iso-8859-15,shift-jis,eucjp-win,sjis-win,iso-8859-1,utf-8 ')
This transcoding only the first valid, such as the first one is iso-8859-15, Western European code can be converted, but the Japanese code will not be able to turn
The first one is Eucjp-win,sjis-win. These Japanese codes can be turned around, and the Western European code does not turn.
Excuse me, how to deal with this situation???
Flex Transit Code functions: Escape,encodeuri,encodeuricomponentCorresponding decoding function in Flex: unescape,decodeuri,decodeuricomponentFirst, escape outputs the%u**** format when encoding Unicode values other than 0-255.In other cases the Escape,encodeuri,encodeuricomponent encoding results are the same.Second, encodeURIComponent is the Chinese, Korean and other special characters into the Utf-8 format URL encoding, so if the background to pass parameters need to use encodeURIComponent ba
When using PHP json_encode to handle Chinese, Chinese will be encoded, become unreadable, similar to the "\u***" format, if you want Chinese characters do not transcode, here are three ways1. Upgrade PHP, in PHP5.4, the problem is finally resolved, JSON added an option: Json_unescaped_unicode, so the name Incredibles, that is, JSON do not encode UNICODE.2. UrlEncode the Chinese characters first and then use the Json_encode,json_encode again after using the UrlDecode to decode, so that the encode
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.