How to convert kanji to strings in iso 8859 1 PHP Advanced Discussion

Updated on technology 2024-05-10
8 answers
  1. Anonymous users2024-02-10

    The reason is because of your string s="Lin Wei";The string encoding is not GBK, you can change GBK to UTF-8.

    string is=new string("utf-8"),"iso-8859-1");

  2. Anonymous users2024-02-09

    If you convert a GBK string to an ISO-8859-1 string, and then decode it in GBK format, of course, it's a question mark.

  3. Anonymous users2024-02-08

    ISO-8859-1 is an English encoding and does not support Chinese encoding.

  4. Anonymous users2024-02-07

    string s="Lin Wei";

    string is=new string("gbk"),"iso-8859-1");

    string tempstr = new string("iso-8859-1"), "gbk");

    That's it.

  5. Anonymous users2024-02-06

    To convert a GB2312 format string to ISO-8859-1, you need to use the intermediate auxiliary class byte, the principle is to convert a string into a byte, and then convert the byte into a string and transcode at the same time, of course, pay attention to the capture of exceptions.

    This process is broadly divided into 2 steps:

    Convert strings to bytes.

    Convert byte to a string and set the encoding format to ISO-8859-1.

    The operation process is shown in the following figure.

  6. Anonymous users2024-02-05

    There are many ways to solve this problem, first of all, you can change the encoding of the web page, the transmission encoding and so on to UTF-8, which is the simplest way.

    8859-1 is a single-byte encoding, while Chinese is a two-byte encoding, so there will be problems with encoding and can also be encoded by conversion.

    Let the resulting string be s1

    The converted string is string s2 = new string("iso-8859-1"),"utf-8");

  7. Anonymous users2024-02-04

    After 2 hours, the problem was finally solved: 1, don't use file get contents(), use this function to get content: function curl($url).

    2. Detect that "ISO-8859-1" is not necessarily this code, you need to see what code is marked by people on the web page, for example"gb2312", and then use this function: $data=mb convert encoding($data,"utf-8","gb2312");

  8. Anonymous users2024-02-03

    Please use the function iconv, or mb convert encoding for specific usage see the manual, if these 2 do not work, please use the following function: function conv utf8 iso8859 7($s) else ; // n-byte character, n>2, discard character

    curr_char = "";

    else if (ord($s[$i]) 128)}return $out;

    Call: echo conv utf8 iso8859 7 ('tenx')

Related questions
4 answers2024-05-10

1. The string format is required, which must be yyyy-mm-dd hh:mm:ss2, iformatprovider). >>>More

11 answers2024-05-10

1. First save the audio file you need to convert in your phone, and then find the following recording to text tool in the application market. Open the home page of the tool is a voice recognition page, where there are recording recognition and file recognition, click on file recognition here. >>>More

15 answers2024-05-10

In our daily entertainment and daily work, if we want to convert ACC format***, we can use some audio conversion tools. Here is an example of the [Fengyun Audio Processing Master] that I used myself. >>>More

10 answers2024-05-10

strm:=''; i:=s2[1]+s2[2]+s2[3]+s2[4]+s2[5]; strq:

Zero One Two Three Wu Lu Qi picked up'; strx:='Pick up thousands of dollars and angles'; for k:=1 to 8 do begin j: >>>More

4 answers2024-05-10

Maybe you're "allergic" to the character interface of the convert command, then use a third-party tool. Among the graphics tools that have this kind of functionality, I recommend Partitio Nmagic. To install and run PartitionMagic, right-click the partition you want to convert to file system in the main window (for example, F:, select "Convert" from the pop-up shortcut menu, then select "NTFS" in "File System", and click the "OK" button. If there are open files in the partition you want to operate, a warning window will pop up, close the file and restart the computer, and the conversion will be automatically completed before entering the system when it is started, and there will also be a hint of relevant information. (During this conversion process, it is also necessary to ensure that the power is not interrupted to avoid system crashes.) )