[#70252] Re: [ruby-cvs:58640] nobu:r51492 (trunk): node.c: NODE_ALLOCA for ALLOCV — Eric Wong <normalperson@...>
Besides possible backwards compatibility, can we drop volatile
3 messages
2015/08/05
[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...
Issue #11420 has been reported by Koichi Sasada.
11 messages
2015/08/06
[#70337] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/11
Nice. Thank you guys for looking into this.
[#70349] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
Btw, did you consider using flexible array to avoid extra malloc
[#70355] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Юрий Соколов <funny.falcon@...>
2015/08/12
I thought to suggest to embed hash_id_table directly into places when it is
[#70356] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— SASADA Koichi <ko1@...>
2015/08/12
On 2015/08/13 4:29, Юрий Соколов wrote:
[#70358] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
SASADA Koichi <ko1@atdot.net> wrote:
[#70509] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — ko1@...
Issue #11276 has been updated by Koichi Sasada.
3 messages
2015/08/21
[#70639] the undefined behavior of an iterator if it is modified inside of the block to which it yields — Daniel Doubrovkine <dblock@...>
(this is my first time e-mailing list list, so apologies for any misstep :)
4 messages
2015/08/31
[ruby-core:70381] [Ruby trunk - Bug #10705] JSON::ParserError#message is wrong encoding (ASCII-8BIT)
From:
nagachika00@...
Date:
2015-08-14 06:21:30 UTC
List:
ruby-core #70381
Issue #10705 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: WONTFIX, 2.1: WONTFIX, 2.2: REQUIRED to 2.0.0:=
WONTFIX, 2.1: WONTFIX, 2.2: DONE
r50339, r50340, r50342 and r50343 were backported into `ruby_2_2` branch at=
r51571.
----------------------------------------
Bug #10705: JSON::ParserError#message is wrong encoding (ASCII-8BIT)
https://bugs.ruby-lang.org/issues/10705#change-53784
* Author: Josh Cheek
* Status: Closed
* Priority: Normal
* Assignee:=20
* ruby -v: ruby 2.3.0dev (2015-01-06 trunk 49159) [x86_64-darwin13]
* Backport: 2.0.0: WONTFIX, 2.1: WONTFIX, 2.2: DONE
----------------------------------------
JSON::ParserError#message is wrong encoding (ASCII-8BIT). I would expect th=
e error to be whatever the internal encoding is (in my case, utf8), perhaps=
inspecting the string in the error message such that all characters would =
be valid in that encoding.
Here is an example of where it becomes an issue:
~~~ruby
# encoding: utf-8
require 'json' # =3D> true
json =3D JSON.dump("=E2=88=9A") # =
=3D> "\"=E2=88=9A\""
begin
result =3D JSON.parse(json)
puts "PARSED: #{result.inspect}"
rescue JSON::ParserError =3D> e
`ruby -v` # =3D> "ruby=
2.3.0dev (2015-01-06 trunk 49159) [x86_64-darwin13]\n"
json.encoding # =3D> #<Enc=
oding:UTF-8>
e.message.encoding # =3D> #<Enc=
oding:ASCII-8BIT>
e.message # =3D> "757:=
unexpected token at '\"\xE2\x88\x9A\"'"
puts "Could not parse #{json.inspect} because #{e.message}" # ~> Encodin=
g::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8B=
IT
end
# ~> Encoding::CompatibilityError
# ~> incompatible character encodings: UTF-8 and ASCII-8BIT
# ~>
# ~> f9.rb:13:in `rescue in <main>'
# ~> f9.rb:5:in `<main>'
~~~
If the parsed string doesn't have a multibyte unicode character, it still h=
appens, but fixes itself when it comes in contact with another string, sinc=
e all its bytes are within the ASCII range.
Documented the actual use case and debugging [here](https://github.com/Josh=
Cheek/seeing_is_believing/issues/46#issuecomment-69007428).
(side thought: should I open another bug since it generates invalid JSON?)
--=20
https://bugs.ruby-lang.org/