uploading Chinese in PHP page

uploading Chinese in PHP page

3
NewbieNewbie
3

    Feb 19, 2006#1

    Hi,

    I tried serveral things to upload Chinese characters in a PHP page. But I get errors when opening the page.

    I have UE 10.20 on a XP pro. SP 2 machine. How should I upload this?

    The only way I could paste Chinese characters into UE was to switch mode U-DOS or U-UNIX.
    But uploading this will result is displaying all php code and errors...

    How to fix this?
    Cheerz
    greetz from china

    6,683583
    Grand MasterGrand Master
    6,683583

      Feb 19, 2006#2

      I think, this is not an uploading problem. You need binary mode for files with Unix line endings (LF only) and ASCII mode for files with DOS line endings (CRLF) if the server is a Unix server. You should better use Unix formatted files and transfer it in binary mode.

      For Chinese characters you need Unicode. So you have to use UTF-8 or UTF-16. The important thing is that you have to tell all programs which interprets the file which encoding you have used. PHP files should have no BOM (byte order mark) but a meta tag which informs the PHP engine and the browsers about the encoding you have used. For an UTF-8 HTML file this meta tag is normally:

      <meta http-equiv="content-type" content="text/html; charset=utf-8">

      and for an UTF-8 XHTML file

      <meta http-equiv="content-type" content="text/html; charset=utf-8" />

      This meta tag should be the first line in the <head> area if the <title> also contains characters encoded in UTF-8.

      The help of UltraEdit v11.20b contains a topic listed in the index as "UTF-8 BOM". This help topic explains the configuration settings for the BOM handling. I can't remember but I think this help should be also available for v10.20. The settings for BOM handling definitively also exists in v10.20.

      For more infos about BOM and Unicode see the FAQ about UTF-8, UTF-16, UTF-32 & BOM.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Feb 20, 2006#3

        Well, I know about the UTF-8. But if the file contains only ????? ( there were Chinese characters ) than it never will work.

        And I am trying to upload a file that contains Chinese txt.
        I think... U-DOS is one of the options (since it is a txt file and not a image)...
        However this one does convert the programming as well.
        And with DOS I only get ????...

        Can you tell me what settings I have to make in order to get a correct page?

        Thanks

        PS: I just upgraded to 11.20b

        6,683583
        Grand MasterGrand Master
        6,683583

          Feb 20, 2006#4

          Does UltraEdit really show "U-DOS" or "U8-DOS"? If it shows "U-DOS", your file is a UTF-16 file and so content="text/html; charset=utf-8" would be wrong because it is content="text/html; charset=utf-16".

          I'm not very familiar with UTF-16 and Chinese characters. So maybe a Chinese user can answer your question better.
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            Feb 23, 2006#5

            I have been testing on the meta tags etc.

            But there is still a question....

            If I upload an U8-DOS file to the server
            I see that this changes to DOS while uploading...
            and back to U8-DOS when done?????

            Can I make sure that it doesn't convert to DOS while uploading?

            6,683583
            Grand MasterGrand Master
            6,683583

              Feb 23, 2006#6

              I never upload files with UltraEdit, so I can't answer your last question. But to verify if upload was OK, simply open the file with your internet browser after upload and look at a character which is saved with 2 bytes. If this character is displayed correct, the upload worked. You can also click in your internet browser on "Edit with ..." or "Source" and look if the 2 byte characters are encoded correct.
              Best regards from an UC/UE/UES for Windows user from Austria