Ticket #3569 (new bug)

Opened 4 years ago

Last modified 2 years ago

ghci can't handle utf-8 chinese char correctly when modify.

Reported by: guest Owned by: judah
Priority: normal Milestone: _|_
Component: GHCi Version: 6.10.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: x86_64 (amd64)
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

ubuntu 8.04, ghc 6.10.4,gnome-terminal if you can't display chinese char and under ubuntu, may be you can use ubuntu's language support. ======================================================= Using chinese string inside ghci such as:

Prelude> "大家好,这是一段中文"

when use backspace, left arrow or any other action cause the cursor relocate.Will find out that the cursor can't relocate correctly, i.e. i use backspace to delete the whole string, ghci still display thing like below: Prelude> "大家好,这

if now use <Enter> to execute, resault just "Prelude>"

After several test i find out that, ghci "display part" treat every chinese char as two chars/bytes(or maybe longer), but ghci "inside" treat chinese char as one unicode char correctly.

Chinese can encode 2 to 4 bytes long, under Linux 2 to 4 bytes under diffrent locale setting, under Windows 2 bytes long.

Attachments

Screenshot.png Download (28.5 KB) - added by guest 4 years ago.
screen after modify

Change History

Changed 4 years ago by guest

screen after modify

Changed 4 years ago by judah

  • owner set to judah
  • status changed from new to assigned

Thanks for the report! This is an issue which needs to be fixed in Haskeline:

 http://trac.haskell.org/haskeline/ticket/81

I'll update this ticket with progress from that one.

Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to Not GHC

Changed 2 years ago by igloo

  • failure set to None/Unknown
  • milestone changed from Not GHC to _|_
Note: See TracTickets for help on using tickets.