stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

UTF8 in type parameters is broken

Open maksbotan opened this issue 5 years ago • 5 comments

Take this code:

data Foo = Foo { foo :: Foo "кек" }

There are non-ASCII UTF8 symbols in the type parameter (and it's perfectly OK).

stylish-haskell does this:

data Foo
  = Foo
      { foo :: Foo "\1082\1077\1082"
      }

This is unacceptable of course :)

maksbotan avatar Oct 17 '20 16:10 maksbotan

I started looking into this issue, but I am having a hard time recreating it. What are your locale settings?

jhmcstanton avatar Oct 24 '20 10:10 jhmcstanton

$ locale 
LANG="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_CTYPE="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_ALL=

I'm on macOS 10.14 if that matters.

maksbotan avatar Oct 24 '20 11:10 maksbotan

Can you provide your configuration as well?

jhmcstanton avatar Oct 24 '20 23:10 jhmcstanton

@jhmcstanton just uncomment records: part in the default config without changing anything else, it's enough to trigger this.

maksbotan avatar Oct 25 '20 10:10 maksbotan

@jaspervdj any idea where to look to resolve this issue? So far I have added tests that show the incorrect behavior and checked

  • putType in Printer
  • printing of string literals in Imports
  • a smattering of other places

but I have not had luck finding where this issue might be.

jhmcstanton avatar Oct 26 '20 20:10 jhmcstanton