Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for UTF-8 identifiers #9

Closed
elnull opened this issue Apr 4, 2013 · 5 comments
Closed

Add support for UTF-8 identifiers #9

elnull opened this issue Apr 4, 2013 · 5 comments

Comments

@elnull
Copy link

elnull commented Apr 4, 2013

Here's valid example in GO language with UTF-8 identifiers:

package main
import "fmt"

func main() {
    var пример = "aaa"
    var 世界 = "bbb"
    fmt.Println(пример, 世界)
}

This is output of GDB session

Breakpoint 1, main.main () at a.go:4
4 func main() {
(gdb) n
5 var пример = "aaa"
(gdb) n
6 var 世界 = "bbb"
(gdb) n
7 fmt.Println(пример, 世界)
(gdb) n
aaa bbb
8 }

This is output of CGDB session

func main() {
var M-PM-?M-Q~@M-PM-8M-PM-<M-PM-5M-Q~@ = "aaa"
var M-dM-8VM-gUL = "bbb"
fmt.Println(M-PM-?M-Q
@M-PM-8M-PM-<M-PM-5M-Q~@, M-dM-8VM-gU~L)
}

@ibuclaw
Copy link
Contributor

ibuclaw commented Apr 4, 2013

I'll add an extra note that D supports UTF-8 characters in variable names as well. :)

@forslund
Copy link
Contributor

To get cgdb to show the variables correctly doesn't seem to be too hard ncurses just need to be replaced with ncursesw (the branch utf8-fix on my fork of cgdb adds a check for ncursesw and uses it if it's available) the problem seem to be that the gdb entry field doesn't accept utf-8 characters so it's impossible to inspect variables with names containing utf-8 symbols. I'll look into the issue and see if I can figure out a way to get it to work...

@forslund
Copy link
Contributor

Ok, this will take some time =) handling of the input in scroller.c is pretty complicated as it is and to add support for utf-8 will take some effort. I'll keep at it but this will take some time.

@oblitum
Copy link

oblitum commented Oct 9, 2013

I'm using gdb 7.5.91.20130417 on Ubuntu 13.04 and, by default, it doesn't support referring to UTF-8 named variables. It displays them correctly, like already said, but trying out p 世界 for example, generates an error about invalid characters on input.

I've added more fixes for UTF-8 display upon @forslund changes at #32.

@mikesart
Copy link
Contributor

mikesart commented Feb 2, 2017

I believe this was fixed. If not, please enter a new bug. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants