Comments (7)
I can't reproduce this using Ruby 1.8.7 (non-REE):
>> require 'htmlentities'
=> true
>> HTMLEntities::VERSION::STRING
=> "4.2.4"
>> coder = HTMLEntities.new
=> #<HTMLEntities:0x7f2aba3496d0 @flavor="xhtml1">
>> string = "“These pretzels are making me thirsty…”"
=> "“These pretzels are making me thirsty…”"
>> s = coder.decode(string)
=> "\342\200\234These pretzels are making me thirsty\342\200\246\342\200\235"
>> puts s
“These pretzels are making me thirsty…”
=> nil
>> $KCODE = 'u'
=> "u"
>> s
=> "“These pretzels are making me thirsty…”"
What do you get from the same commands?
from htmlentities.
Looks like an issue with ree 1.8.7?
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10.6.0]
>> require 'htmlentities'
=> true
>> HTMLEntities::VERSION::STRING
=> "4.2.4"
>> coder = HTMLEntities.new
=> #<HTMLEntities:0x100593840 @flavor="xhtml1">
>> string = "“These pretzels are making me thirsty…”"
=> "“These pretzels are making me thirsty…”"
>> s = coder.decode(string)
=> "\342\200\234These pretzels are making me thirsty\342\200\246\342\200\235"
>> puts s
“These pretzels are making me thirsty…”
=> nil
>> $KCODE = 'u'
=> "u"
>> s
=> "“These pretzels are making me thirsty…”"
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02
>> require 'htmlentities'
=> true
>> HTMLEntities::VERSION::STRING
=> "4.2.4"
>> coder = HTMLEntities.new
=> #<HTMLEntities:0x1015a1d18 @flavor="xhtml1">
>> string = "“These pretzels are making me thirsty…”"
=> "“These pretzels are making me thirsty…”"
>> s = coder.decode(string)
=> "\342\200\234These pretzels are making me thirsty\342\200\246\342\200\235"
>> puts s
“These pretzels are making me thirsty…”
=> nil
>> $KCODE = 'u'
=> "u"
>> s
=> "“These pretzels are making me thirsty…\342\200\235"
from htmlentities.
It does seem like it's REE rather than HTMLEntities, and specifically either irb or the implementation of inspect
. What do you get if you do this with REE:
>> $KCODE = 'u'
=> "u"
>> "\342\200\235"
=> "”"
If you get an escape sequence in the last line, then I'll assume that it's a problem with REE and close this issue, if that's OK.
from htmlentities.
ree output is "\342\200\235"
Thanks for your help. Any idea for a work around?
from htmlentities.
Sounds like a bug in REE then. Are you convinced it's really a problem? Do you get escape characters instead of the quote anywhere except in irb? Because if it's only in irb, then it's just an irritation but shouldn't actually affect anything at an operational level.
from htmlentities.
(Closing this as I'm confident it's not an HTMLEntities bug)
from htmlentities.
Update: I tested this on REE 1.8.7-head and it works. I think the REE 1.8.7-2011.01 includes the fix.
from htmlentities.
Related Issues (20)
- Cannot Decode , HTML to Comma HOT 6
- Add License information to gemfile HOT 8
- NameError: uninitialized constant HTMLEntities::Encoder::Encoding HOT 5
- Option to exlude some characters from being decoded HOT 8
- Verify HTML entity names HOT 4
- decode fails on html_safe strings HOT 2
- Remove http://htmlentities.rubyforge.org/ link in the description on GitHub HOT 1
- Encode Registered Trademark (®) HOT 1
- Expanded encoder doesn't encode colon character HOT 2
- doesn't decode &Amp; - purposeful? HOT 1
- Decode of TM symbol inconsistent between entity name and code HOT 1
- expanded.rb - warning: key "inodot" is duplicated and overwritten on line 466 HOT 4
- Using this with Controller HOT 1
- Encoding for "μ" does not seem to work HOT 6
- Typo in files: "subE" is ⫅, not ⊆ HOT 1
- Improperly decoding apostrophe HOT 2
- "\xE2" from ASCII-8BIT to UTF-8 HOT 1
- Add support for case-insentitive decoding
- Add support for incorrect numerical entity format
- Add support for HTML5 entities (specifically, ≈)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from htmlentities.