Skip to content

Commit 391e660

Browse files
committed
don't fail when cannot encode string to UTF8
1 parent 93b4605 commit 391e660

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ def print_variable(name, value, kind)
160160
end
161161

162162
if value_str.respond_to?('encode')
163+
begin
163164
value_str = value_str.encode("UTF-8")
165+
rescue
166+
end
164167
end
165168
value_str = "[Binary Data]" if (value_str.respond_to?('is_binary_data?') && value_str.is_binary_data?)
166169
print("<variable name=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\"/>",

0 commit comments

Comments
 (0)