husk-scheme icon indicating copy to clipboard operation
husk-scheme copied to clipboard

"format" fn from SRFI-28 broke some non-standard ASCII chars (UTF-8 set)

Open felipelalli opened this issue 8 years ago • 2 comments

Example: "á" it shows �

felipelalli avatar Mar 01 '16 06:03 felipelalli

Do you have a code example? Do you see the same behavior from ghci when working with these chars?

Husk (and Haskell, too) uses unicode for chars so I would have expected this to work.

justinethier avatar Mar 01 '16 18:03 justinethier

Do you have a code example?

Yes.

(import (scheme base)
        (scheme write)
        (srfi 28))

(display (format "~a Eu sou uma mensagem em ~a." "Olá" "português"))

Output:

Ol� Eu sou uma mensagem em portugu�s.%

Do you see the same behavior from ghci when working with these chars?

No.

Husk (and Haskell, too) uses unicode for chars so I would have expected this to work.

Me too. It should be an specific issue with the SRFI-28 implementation. I can use UTF-8 non-standard chars normally if not inside the format fn.

felipelalli avatar Mar 01 '16 19:03 felipelalli