1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-10 16:14:18 +02:00

Source.php now strips leading UTF-8 BOMs and added BOMs to javascript test files to test this, and note in README.

This commit is contained in:
Steve Clay
2008-05-22 15:23:28 +00:00
parent ae22377b26
commit 97eaa576ed
4 changed files with 13 additions and 3 deletions

6
README
View File

@@ -65,3 +65,9 @@ MINIFY USAGE
Example 1 shows an example of using Minify to serve external CSS and JS files
with far-off Expires headers. Clients will always have up-to-date versions
because Minify_Build is used to time stamp the URLs.
FILE ENCODINGS
Minify *should* work fine with files encoded in UTF-8 or other 8-bit
encodings like ISO 8859/Windows-1252. Leading UTF-8 BOMs are stripped from
all sources to prevent duplication in output files.

View File

@@ -78,12 +78,16 @@ class Minify_Source {
*/
public function getContent()
{
return (null !== $this->_filepath)
$content = (null !== $this->_filepath)
? file_get_contents($this->_filepath)
: ((null !== $this->_content)
? $this->_content
: call_user_func($this->_getContentFunc, $this->_id)
);
// remove UTF-8 BOM if present
return (pack("CCC",0xef,0xbb,0xbf) === substr($content, 0, 3))
? substr($content, 3)
: $content;
}
/**

View File

@@ -1,4 +1,4 @@
var MrClay = window.MrClay || {};
var MrClay = window.MrClay || {};
/**
* Simplified access to/manipulation of the query string

View File

@@ -1,4 +1,4 @@
// http://mrclay.org/
// http://mrclay.org/
(function(){
var
reMailto = /^mailto:my_name_is_(\S+)_and_the_domain_is_(\S+)$/,