File: aaa.rb

package info (click to toggle)
ruby-oj 2.17.4-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 968 kB
  • ctags: 1,672
  • sloc: ansic: 10,658; ruby: 6,524; makefile: 2
file content (21 lines) | stat: -rwxr-xr-x 387 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby
# encoding: UTF-8

$VERBOSE = true

%w(lib ext test).each do |dir|
  $LOAD_PATH.unshift File.expand_path("../../#{dir}", __FILE__)
end

#require 'json'
require 'oj'
Oj.mimic_JSON

JSON.dump_default_options[:ascii_only]=true
puts JSON.dump_default_options

puts JSON.dump(["a😬sdf"])

JSON.dump_default_options = {:ascii_only=>false}

puts JSON.dump_default_options