Coder Social home page Coder Social logo

Comments (2)

Bill-Gray avatar Bill-Gray commented on May 24, 2024

(G__gle Translate does what appears to me to be a surprisingly good job of translating the above text.)

Thanks for posting this. It's an interesting solution to the fullwidth/halfwidth character problem. It will work only for the Windows console version (I think), but perhaps that's all you need. Also, it assumes all Unicode points above 0x7ff (those encoded as three bytes in UTF8) are fullwidth; it's really more complex than that. Also, points 0x100 to 0x7ff (where retval == 2), including many European languages, are ignored. (Everything in that range is either half- or zero-width.)

You could use this mk_wcwidth() function (Markus Kuhn's version of wcwidth() for Windows) and revise your code to say

if( mk_wcwidth( wch) == 2 && x)
    {
    /* use your fullwidth-character solution */
    }
else
     /* display as a half-width character

You'll still have problems with fullwidth characters. Mainline PDCurses is ill-suited to Asian languages. I had to make a lot of changes before fullwidth characters worked properly; see my fork for details. Among other things, a 'dummy' character has to be stored next to each fullwidth character to make everything line up properly.

Also, mainline PDCurses does not support combining characters or supplemental-plane Unicode (Unicode points past 64K). I don't know if that's a problem for your use.

from pdcurses.

GitMensch avatar GitMensch commented on May 24, 2024

Translation:

Amendments to typographical issues when printing strings containing Chinese in the default console of Window10 in Simplified Chinese

Printing the strings containing Chinese in the default console of Window10 in Simplified Chinese will cause typographical problems and Chinese characters will be superimposed. I traced some modifications here to achieve normal Chinese character layout, but I have no environment to test Japanese , Korean, Traditional Chinese and other Asian languages and other countries.

The following is what I modified: [...]
The method of modification is rough, and it would be better if the original author could make the official modification.

from pdcurses.

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.