Comments (2)
(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.
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)
- Is it normal that several styles don't work correctly in PowerShell? HOT 7
- Enabling support for showing window after process put to sleep (SDL2) HOT 4
- SDL_GetError() returns "Parameter 'src' is invalid" after call to initscr() for sdl2 HOT 2
- ncurses compat: add WACS_D_LRCORNER and other double line drawings
- SDL2 port missing support for PDC_PRESERVE_SCREEN HOT 4
- WinCon, endwin() kills QuickEdit/InsertMode options and more.. HOT 8
- touchoverlap() un-touches parts of lines HOT 1
- addition of vt port from Bill-Gray HOT 1
- additional gitpod config
- No rule to make target '../common/libobjs.mif'. Stop. HOT 5
- Unable to get mouse position when hovering HOT 9
- SDL2 build fails for Mac/Linux in Github HOT 2
- When resizing the SDL2 window, the surface isn't refreshed
- Build failure when building PDcurses DLL library for Window console HOT 1
- Debugging? HOT 1
- printw.c - for Unicode? HOT 3
- wresize doesn't return ERR if the window size requested is too big HOT 3
- Unable to initialize soft label keys HOT 2
- missing escapes in configure script HOT 1
- Scrolling and inserting/deleting lines
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdcurses.