SyntaxFix
Write A Post
Hire A Developer
Questions
For prevent an error "can't modify frozen string" for encoding a varible you can use: var.dup.force_encoding(Encoding::ASCII_8BIT) or var.dup.force_encoding(Encoding::UTF_8)
var.dup.force_encoding(Encoding::ASCII_8BIT)
var.dup.force_encoding(Encoding::UTF_8)