tobym / nokogiri-pretty

Pretty-print the contents of a Nokogiri document
MIT License
14 stars 4 forks source link

ISO-8859-1? #4

Open benlieb opened 8 years ago

benlieb commented 8 years ago

Why is this not a config option?

ISO-8859-1

nilbus commented 8 years ago

Seems like a reasonable option. Do you feel comfortable submitting a pull request to add this option?

benlieb commented 8 years ago

When I looked earlier today, I recall that this was actually in the xslt file. I'm not sure how the config option would be applied, but I might have time to look into it next week. This week is packed. I guess there could be another xslt file for utf-8, etc, or maybe there's a way to apply it after the xslt is read?

I'd have to look at how that works in Nokogiri.

nilbus commented 8 years ago

I assume you're referring to this: https://github.com/tobym/nokogiri-pretty/blob/master/lib/indent.xsl#L2

I don't have a clear idea of what the best thing is either. I suppose you could work around it by copying the XSLT into your own project, modifying it to use UTF-8, and providing it to the human method that hasn't been released. We'll see if @tobym responds.

@tobym Alternatively we could just change the XSLT to output UTF-8 instead of ISO-8559-1 and bump the major version number, since UTF-8 is generally preferred everywhere.

benlieb commented 8 years ago

The last suggestion is probably the biggest bang for your buck. I got this working locally by just changing ISO-8559-1 to UTF-8 in the current rubygems version.