Slide 65
Slide 65 text
• - https://github.com/rspec/rspec-support/pull/151#discussion_r22572815
▪ I was confusing enc.ascii_compatible? ▪ with rb_enc_check ◦ where enc_compatible is `Encoding.compatible?(str1,str2)
◦ - https://github.com/rspec/rspec-support/pull/151#discussion_r22572359
https://github.com/rspec/rspec-support/pull/151#issuecomment-70045539
- https://github.com/rspec/rspec-support/pull/151#discussion_r22637355
per http://stackoverflow.com/questions/21289181/char174-returning-the-value-of-char0174-why which links to http://www.theasciicode.com.ar/extended-ascii-code/angle-quotes-guillemets-right-pointing-double-angle-french-quotation-marks-ascii-code-174.html
- https://github.com/rspec/rspec-support/pull/151#discussion_r22991439
Hmm, looking at http://stackoverflow.com/questions/1259084/what-encoding-code-page-is-cmd-exe-using and https://github.com/ruby/ruby/blob/9fd7afefd04134c98abe594154a527c6cfe2123b/ext/win32ole/win32ole.c#L540, it appears you can get the current encoding (codepage)
on windows in the command prompt by running `chcp` and change it to utf8 via `chcp 65001`.
- https://github.com/ruby/ruby/blob/9fd7afefd04134c98abe594154a527c6cfe2123b/ext/win32ole/win32ole.c#L540
- https://github.com/rspec/rspec-support/pull/134
- Related to https://github.com/rspec/rspec-core/pull/1760
- https://github.com/rspec/rspec-support/pull/151
- https://github.com/rspec/rspec-support/pull/152
- https://github.com/rspec/rspec-support/pull/167
- https://github.com/rspec/rspec-support/pull/172
- https://github.com/rspec/rspec-support/pull/173 (closed without merging)
- https://github.com/rspec/rspec-support/pull/174
- https://github.com/rspec/rspec-dev/pull/114
- https://github.com/rspec/rspec-dev/pull/115 (open)
- https://github.com/rspec/rspec-core/pull/1871 (open)
- https://github.com/rspec/rspec-support/pull/171 (split into other PRs)
- https://github.com/rspec/rspec.github.io/pull/65 (open)
- TBD
- https://github.com/rspec/rspec-support/pull/176
- https://github.com/rspec/rspec-support/pull/167
- Differ tests no longer use Differ to report diff expectation Differ https://github.com/rspec/rspec-support/pull/174
https://github.com/ruby/ruby/blob/aacc35e144/encoding.c#L1741
- https://github.com/rspec/rspec-support/pull/151#discussion_r22637177
https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L4289
https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L3119-lL312
and see https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L4242-L4250 and https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L3917-L3973 (and maybe https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L4289-L4294 etc)
And then probably also look at the weirdness that is converter not found: https://github.com/rubyspec/rubyspec/blob/archive/core/string/shared/encode.rb#L96-L101
myronmarston: Wow, I had no idea just how weird and complex ruby encoding behavior is!
- https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L4242-L4250
- https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L3917-L3973
- https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L4289-L4294
- https://github.com/ruby/ruby/blob/34fbf57aaa/transcode.c#L3119-lL3121
- https://github.com/rubyspec/rubyspec/blob/archive/core/string/shared/encode.rb#L96-L101
- https://github.com/rubyspec/rubyspec/blob/91ce9f6549/core/string/fixtures/utf-8-encoding.rb
- https://github.com/bf4/rspec-support/commit/db2c3a43e1cdb0fc1491394328f78c712aa9ed19
- https://github.com/jruby/jruby/blob/c1be61a501d1295fa1ea9f894e1a8e186411f32a/test/mri/ruby/envutil.rb#L150
rack invalid https://github.com/ruby/ruby/commit/4a50d447d9618b2e3df126e159aa1d735e429a70
Refs:
- https://github.com/rspec/rspec-support/pull/167
- https://github.com/rspec/rspec-support/pull/151
- https://github.com/rspec/rspec-support/pull/134#issuecomment-68984440
Documentation: How to test:
- https://github.com/rspec/rspec-support/pull/171
-
Ruby sources
- The default external encoding is initialized by the locale or -E option. https://github.com/ruby/ruby/blob/ca24e581ba/encoding.c#L1398
- Not sure how to do a better test, since locale depends on weird platform-specific stuff https://github.com/rubyspec/rubyspec/blob/91ce9f6549/core/encoding/find_spec.rb#L57
- Encoding.compatible? https://github.com/rubyspec/rubyspec/blob/91ce9f6549/core/encoding/compatible_spec.rb#L31
-
◦