Results 1 to 2 of 2

Thread: Extension File Encoding

  1. #1
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Extension File Encoding

    I was just caught out by an extension php file being encoded as Dos/Windows ANSI.
    When Settings::Global Settings::Enable Gzip was selected the extension frontend output was returning
    The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression
    to Firefox, and a blank page to IE.

    I changed the file encoding using Notepad++ to Unix ANSI and it fixed it.
    From what I have read this is because Contao uses ob_start("ob_gzhandler") if it can to compress the files, and ob_start("ob_gzhandler") does not like what are called BOM characters (which are visually hidden, so hard to detect).

    Which leads me to the question....

    When making an extension, what encoding should be used for the files (php, js, tpl etc).

    I also notice that sometimes when I transfer files down from the server via Filezilla and open them in Notepad++ they are not always the same encoding as they were straight from the unzipped Contao package.
    Has anyone experienced or had a problem with this??

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Extension File Encoding

    Normally I use the UNIX Line Endings (LF) and Encoding WESTERN (Mac OS Roman) or UNICODE (UTF-8) That should do it.

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
  •