Displaying 1 result from an estimated 1 matches for "add_log_message".
2007 Aug 27
0
how can I get malformed UTF-8 characters to display properly?
...#39;'[^[:ascii:]]'', {:encoding =>
Oniguruma::ENCODING_UTF8})
chars = []
data.each_char{|c|chars << c}
chars.collect do |c|
if o.match c
begin
"&##{c.unpack(''U*'').first};"
rescue ArgumentError
add_log_message("Has malformed UTF-8 characters")
#handling malformed UTF-8 : a huge pain and possibly future
cause of problems
bytes = []
c.each_byte{|b| bytes << b}
# assumes we''re handling at most, 2-byte strings. We have
no way if the malformed...