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

UTF-8 support is wrong #64

Closed
vit1251 opened this issue Dec 16, 2021 · 4 comments
Closed

UTF-8 support is wrong #64

vit1251 opened this issue Dec 16, 2021 · 4 comments

Comments

@vit1251
Copy link

vit1251 commented Dec 16, 2021

Example:

package main

import (
        "github.com/rthornton128/goncurses"
        "log"
        "time"
)

func main() {

        stdscr, err1 := goncurses.Init()
        if err1 != nil {
                log.Fatal("init:", err1)
        }
        defer goncurses.End()

        err2 := goncurses.StartColor()
        if err2 != nil {
                log.Fatal("StartColor", err2)
        }

        /* Box Drawing unicode example */
        stdscr.Print("┌─ Title ──────────────────────┐")
        stdscr.Print("│                              │")
        stdscr.Print("└──────────────────────────────┘")
        stdscr.Refresh()

        time.Sleep(1 * time.Minute)

}

Result:

image

@rthornton128
Copy link
Owner

goncurses is not configured to allow for UTF-8. First, you need to make sure the locale is set correctly (out of scope of this project) and second, goncurses would need to be linked against lncursesw for the wide character version of the library. You should be able to clone this repo and make those changes to try it.

I think there may be a case to be made to link to the wide character library by default since Go supports utf-8 out of box.

@vit1251
Copy link
Author

vit1251 commented Dec 16, 2021

You should be able to clone this repo and make those changes to try it.

Yep. Already do in https://github.com/vit1251/goncurses
I change name on go-ncursesw later to avoid search engine is ambiguous results by name.

@vit1251 vit1251 closed this as completed Dec 16, 2021
@vit1251
Copy link
Author

vit1251 commented Dec 17, 2021

Rename complete in https://github.com/vit1251/go-ncursesw

@rthornton128
Copy link
Owner

I've added a wiki page detailing what may be necessary for others who are also looking for UTF-8 support. https://github.com/rthornton128/goncurses/wiki/Internationalization-(I18n)

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

No branches or pull requests

2 participants