Ok, my bad… in ruby you are supposed to call .b on a string to return a copied string whose encoding is ASCII-8BIT.
.b
https://ruby-doc.org/core-2.3.0/String.html#method-i-b