SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ANSI and UNICODE php files

    PHP files saved as ANSI can be processed correctly by PHP and Apache, but when I save the php into UNICODE, it can't work, how can I make PHP and Apache process PHP files in UNICODE? Thanks!

  2. #2
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean by saying "it can't work"? I assure you that character range used by PHP (ASCII) has the same code points in both ANSI (Windows-1252) and Unicode so there are no issues.

    There may be an issue with "output has already been sent" if you're saving your Unicode files with BOM (you should save without it).

  3. #3
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ansi is not an encoding, it's an organisation. Did you mean ascii, which is a charset and an encoding, created by the ansi organisation? Or perhaps you mean iso-8859-1, which is another charset/encoding, incidentally being a superset of ascii.

    Unicode is not an encoding either - It's a charset. There are several encodings capable of representing the unicode charset. For example utf-8.

    Most encodings - including those capable of representing unicode - are ascii-compatible.

    php is mostly ignorant of encodings, as long as they are ascii-compatible.

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ANSI refers to cp1252 in the Windows world and it persists from the past. A lot of Windows software still call cp1252 ANSI.

  5. #5
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sk89q View Post
    ANSI refers to cp1252 in the Windows world and it persists from the past. A lot of Windows software still call cp1252 ANSI.
    Thanks - I didn't know that.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •