summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormwrock <matt@mattwrock.com>2020-11-11 14:58:39 -0800
committermwrock <matt@mattwrock.com>2020-11-11 14:58:39 -0800
commit5e8dce337cfe7e72fd8390b19e85ff626cfbcab4 (patch)
treee61ffb282d1dbd3b36447a7bda75b822c36128e4 /lib
parentc8dfa0b4691d1e75d53117ea53ee6c6c2755f150 (diff)
downloadchef-5e8dce337cfe7e72fd8390b19e85ff626cfbcab4.tar.gz
provide a registry_key example that creates a multibyte binary value
Signed-off-by: mwrock <matt@mattwrock.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/registry_key.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/resource/registry_key.rb b/lib/chef/resource/registry_key.rb
index 7e51ea1ef6..ad85838d41 100644
--- a/lib/chef/resource/registry_key.rb
+++ b/lib/chef/resource/registry_key.rb
@@ -40,12 +40,13 @@ class Chef
# values [{
# :name => "ValueWithBadData",
# :type => :binary,
- # :data => 255.chr * 1
+ # :data => [0, 1, 2].map(&:chr).join
# }]
# action :create
# end
#
- # will raise Encoding::UndefinedConversionError: "\xFF" from ASCII-8BIT to UTF-8.
+ # will raise Encoding::UndefinedConversionError: "\x01\x02\x03" from ASCII-8BIT to
+ # UTF-8.
#
# To avoid sending data that cannot be nicely converted for json, we have
# the values method return "safe" data if the data type is "unsafe". Known "unsafe"