moshiba / pbar

Low overhead C++ progress bar
GNU General Public License v3.0
8 stars 2 forks source link

Support bar fractions with UTF-8 #27

Open moshiba opened 4 years ago

moshiba commented 4 years ago

in short, use these

█
▉
▊
▋
▌
▍
▎
▏

to characterize small fractions of progress.

We can achieve this with the ICU library, or with libraries like <locale> and <codecvt>.

The code points we're looking for is 0x2588 -0x258F

moshiba commented 4 years ago

These 3-byte characters require variable-length output buffer which is slow. Even if we pre-allocate a large-enough buffer these characters make reusing buffer sections hard, sections such as remaining time estimation and step counter will need to be pushed back. I suggest falling back to plain # instead of UTF-8 bar fractions, including full bars: