Closed unity closed 10 years ago
Rouge expects content to be a valid UTF8 string. If the string does not contain UTF-8 Characters, it is casted to ASCII-8BIT, Triggerring an error:
To reproduce: index.slim
- code('html') do == "BOB".force_encoding(Encoding::UTF_8)
=>
Bad encoding: ASCII-8BIT,BINARY. Please convert your string to UTF-8.
index.slim
- code('html') do == "BOBé".force_encoding(Encoding::UTF_8)
=> Works.
We make sure "content" passed to highlighter a valid UTF8 string.
+1 on this fix. Just ran into the exact error running Slim.
Thanks!
Rouge expects content to be a valid UTF8 string. If the string does not contain UTF-8 Characters, it is casted to ASCII-8BIT, Triggerring an error:
To reproduce: index.slim
=>
index.slim
=> Works.
We make sure "content" passed to highlighter a valid UTF8 string.