Giter Site home page Giter Site logo

Comments (10)

ArthurSonzogni avatar ArthurSonzogni commented on August 16, 2024

Hello!

Full width characters are supporters.

What terminal are you using? Maybe your terminal doesn't support rendering them?

See my test on examples/dom/border.cpp
image

You can try the example examples/component/input.cpp demo on your terminal and input some full width characters.

from ftxui.

hcwanz avatar hcwanz commented on August 16, 2024

It seems like it's really my problem here

from ftxui.

ArthurSonzogni avatar ArthurSonzogni commented on August 16, 2024

Maybe ;-)
What OS and terminal are you using?

from ftxui.

hcwanz avatar hcwanz commented on August 16, 2024

windows &&windows terminal
When using _getch normally, you can input display full width characters.
But in input.cpp, when entering, only garbled characters will be displayed.

from ftxui.

hcwanz avatar hcwanz commented on August 16, 2024

1

from ftxui.

hcwanz avatar hcwanz commented on August 16, 2024

Not all of them will output messy codes.
"当饭森" will only display "森";
森
"埏埴" can be displayed normally, and even some subsequent characters can be displayed normally, but the “,当” cannot be displayed.
埏埴
The "测试" will display garbled text
测试

from ftxui.

hcwanz avatar hcwanz commented on August 16, 2024

When I output them individually using string, they can be output normally
image

from ftxui.

hcwanz avatar hcwanz commented on August 16, 2024

Maybe ;-) What OS and terminal are you using?

It seems that the text determination in EatCodePoint is not correct in my environment.
As shown in the figure below, ',' in string is '1010 0011 1010 1100', which is indeed 2 bytes, but it is different from the judgment in the function.
May I ask why this is the case.
1

from ftxui.

ArthurSonzogni avatar ArthurSonzogni commented on August 16, 2024

In UTF8, we considers ", " to be two 1-byte characters:

  • 00101100 => ','
  • 00100000 => ' '

Not all of them will output messy codes.
"当饭森" will only display "森";

"埏埴" can be displayed normally, and even some subsequent characters can be displayed normally, but the “,当” cannot be displayed.

I checked locally on Linux:

image

It was working correctly.

I guess I should try on Microsoft Windows terminal. Thanks for your useful input!

from ftxui.

hcwanz avatar hcwanz commented on August 16, 2024

... I know there's an error. Chinese characters should occupy 3 bytes in utf8, and the default encoding for window is gbk.
When Chinese characters occupy two bytes, it indicates that they are not in utf8 format.

from ftxui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.