Skip to content

Allow to set encoding config for compass filter. #523

Open
wants to merge 3 commits into from

5 participants

@tristanlins

This is the successor of #511 including a unit test.
Unfortunately github does not update closed PRs, so it was necessary to create a new one. :-\

@mpdude
mpdude commented Mar 31, 2014

Is there a PR already that makes this configurable in the Symfony2 AsseticBundle?

@mpdude
mpdude commented Apr 2, 2014

@kriswallsmith maybe we could get this even for older Assetic versions?

To me it seems that as of OS X 10.9 (Mavericks), compass barks at files containing non-ascii chars. Seems the default file encoding is now us-ascii; never had this problem before so maybe the OS upgrade changed defaults...?

This PR would be a convenient way to fix or work around it.

/cc @mmintel

@kriswallsmith kriswallsmith and 1 other commented on an outdated diff Apr 3, 2014
tests/Assetic/Test/Filter/CompassFilterTest.php
@@ -69,4 +69,28 @@ public function testCompassMixin()
$this->assertContains('text-decoration', $asset->getContent());
}
+
+ public function testDefaultEncoding()
+ {
+ $asset = new FileAsset(__DIR__.'/fixtures/compass/unicode.scss');
+ $asset->load();
+
+ $this->filter->setDefaultEncoding('utf-8');
+ $this->filter->setExternalEncoding('utf-8');
+ $this->filter->filterLoad($asset);
+
+ $this->assertContains('foo', $asset->getContent());
@kriswallsmith
Owner
kriswallsmith added a note Apr 3, 2014

Why are you asserting that the assets include "foo"?

@tristanlins
tristanlins added a note Apr 3, 2014

That is a good question, I don't remember why ;-D
The assertion seems to be nonsense this way O.o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@hilobok
hilobok commented Aug 5, 2014

+1 for this

@tristanlins

I fixed the assertion by testing for the unicode character Ω instead of foo ;-)

@tristanlins

@mpdude no, there is no patch for the SF2 bundle yet.

@x3ro
x3ro commented Jan 22, 2016

👍 This impacts me on OS X as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.