Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set appropriate encoding for source_map #152

Merged
merged 2 commits into from Mar 3, 2020
Merged

Conversation

shwaka
Copy link
Contributor

@shwaka shwaka commented Sep 7, 2019

Set appropriate encoding for the string @source_map of Engine, similarly to that of the string css in Engine#render.

This PR will fix the error in the last line of the following code:

# coding: utf-8
require "sassc"

template = <<EOS
body {
  // 赤
  color: red;
}
EOS
options = {
  :source_map_file => "foo.css.map",
  :source_map_contents => true
}
engine = SassC::Engine.new(template, options)
engine.render
source_map = engine.source_map
puts source_map             # includes non-ASCII character "赤"
puts source_map.encoding    # => ASCII-8BIT (UTF-8 is expected)
source_map.encode("UTF-8")  # throws Encoding::UndefinedConversionError

Execute force_encoding only when @source_map is a string.
@bolandrm bolandrm merged commit 2bf3910 into sass:master Mar 3, 2020
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request May 17, 2020
Update to ruby-sassc to 2.3.0.


- **2.3.0**
  - [Fix rake gem:native task](sass/sassc-ruby#196)
  - [disable lto flag for darwin + nix](sass/sassc-ruby#166)
  - [Sort input file list](sass/sassc-ruby#178)
  - [Set appropriate encoding for source_map](sass/sassc-ruby#152)
  - [allow passing functions directly](sass/sassc-ruby#162)
  - [always dispose data context](sass/sassc-ruby#161)
  - [Update libsass to 3.6.3](sass/sassc-ruby#164)
  - [Restore strip symbols](sass/sassc-ruby#184)
  - [Default --march-tune-native to false](sass/sassc-ruby#158)
  - [Fix compile issue on Mac OS X](sass/sassc-ruby#174)
  - [Test on TruffleRuby in TravisCI](sass/sassc-ruby#171)
  - [Use RbConfig::MAKEFILE_CONFIG['DLEXT'] instead of hardcoding extensions](sass/sassc-ruby#173)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants