Feature #12460
closed
Provide Unicode Version information in a better location that UnicodeNormalize::UNICODE_VERSION
Added by duerst (Martin Dürst) over 8 years ago.
Updated almost 3 years ago.
Description
Currently, the Unicode version used in a specific version of Ruby is available
as UnicodeNormalize::UNICODE_VERSION
, from lib/unicode_normalize/tables.rb
.
It is rather unnatural to have to do
require 'unicode_normalize/normalize'
e.g. in test/ruby/enc/test_case_comprehensive.rb
The Unicode version is also available for make, as $(UNICODE_VERSION)
.
The Unicode version should be available directly in Ruby, e.g. as
RUBY_UNICODE_VERSION
or some such.
+1 to avoid require to get that info, but wonder if it is worth adding new toplevel constant. Maybe place it under String:: or Regexp:: ?
Shyouhei Urabe wrote:
Maybe place it under String:: or Regexp:: ?
Anything like that would be fine by me.
Or RbConfig::CONFIG['UNICODE_VERSION']
?
RbConfig::CONFIG['UNICODE_VERSION']
looks just fine.
Matz.
- Assignee set to duerst (Martin Dürst)
- Assignee changed from duerst (Martin Dürst) to nobu (Nobuyoshi Nakada)
If I add e.g.
puts ' CONFIG["UNICODE_VERSION"] = "$(UNICODE_VERSION)"'
as line 185 in tool/mkconfig.rb, I get a line
CONFIG["UNICODE_VERSION"] = "$(UNICODE_VERSION)"
to show up in rbconfig.rb, but in contrast to all the other $(...) variables in that file,
it doesn't get resolved, so that I only get the following:
$ ruby -e 'puts RbConfig::CONFIG["UNICODE_VERSION"]'
$(UNICODE_VERSION)
This is as far as I got, so I'm hoping on some help from Nobu.
- Status changed from Open to Closed
Applied in changeset ruby-trunk:r55417.
Unicode Version in RbConfig
- tool/mkconfig.rb: provide Unicode Version information as
RbConfig::CONFIG['UNICODE_VERSION'].
[ruby-core:75845] [Feature #12460]
- Related to Feature #12546: Remove UnicodeNormalize::UNICODE_VERSION added
- Related to Feature #15341: Provide emoji version as RbConfig::CONFIG['UNICODE_EMOJI_VERSION'] added
- Project changed from 14 to Ruby master
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0