irundaia / sbt-sassify

sbt-web plugin for Sass files
Apache License 2.0
68 stars 17 forks source link

Issue with SBT 1.1.0 and fontawesome #35

Closed LogicalTime closed 6 years ago

LogicalTime commented 6 years ago

Using sbt-sassify 1.4.11, SBT 1.1.0 and webjars fontawesome 4.7.0 there are issues with the compiled css. All the icons show up as triple question marks. This doesn't happen when you switch to SBT 0.13.16 and keep everything the same. I think it's escaping the icon codes incorrectly? I'll follow up with an example project within 24hrs.

LogicalTime commented 6 years ago

I just confirmed that this issue happens with sbt1.1.1 as well. Here is a project you can clone and check out: https://github.com/LogicalTime/sassify-sbt-error

I described the erroneous output in the readme.

LogicalTime commented 6 years ago

I tried it with SBT 1.0.4 and there are no problems. So that must mean the issue is on the SBT end. Could you track down the issue a little more specifically so we can submit an issue?

irundaia commented 6 years ago

Hi @LogicalTime .

I've tried to find a thing SBT changed causing this issue. But I can't find it. I did manage to find a workaround though. I'll try to do some more testing here.

LogicalTime commented 6 years ago

Thanks for the response! Maybe it's a bug from SBT, Scala, or somewhere else that was fixed and so the error started popping up

LogicalTime commented 6 years ago

Would you mind sharing the work around? I'd like to be able to use SBT 1.1.x. also it could give insight into figuring out how the issue came about.

irundaia commented 6 years ago

I'm currently working on release 1.4.12. This includes the fix for font-awesome.

irundaia commented 6 years ago

@LogicalTime, I've released v1.4.12. Could you have a look at whether this has solved your problems with font-awesome?

LogicalTime commented 6 years ago

Looks good to me on my test project! Thank you! What was the source of the issue?

irundaia commented 6 years ago

Good to hear that your issues have been solved. :)

So the problem was that Libsass always outputs the compiled css using UTF-8 encoding. Prior to sbt 1.0, the resulting string (when passing it to Java) was correctly interpreted as UTF-8. With sbt 1.+, the String got interpreted in some other ecoding (presumably the platform standard).

To fix it, I only let JNA deal with passing the bytes to Java. In Java the bytes are then interpreted as a UTF-8 String.

To be frank, I'm not sure what caused JNA to start interpreting the String differently.

LogicalTime commented 6 years ago

Thanks! Really go to know in case I see something similar happen in the future.