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

Support multi-byte character sets in config file #72

Closed
tsjensen opened this issue Feb 17, 2021 · 4 comments
Closed

Support multi-byte character sets in config file #72

tsjensen opened this issue Feb 17, 2021 · 4 comments
Assignees

Comments

@tsjensen
Copy link
Member

tsjensen commented Feb 17, 2021

We already have Unicode and general multi-byte character set (MBCS) support for input text (from #1), but we'd also like to have that for the config file, so that we can design boxes based on Unicode box drawing characters.

At the moment, the config file is in ASCII format. It should be in UTF-8 format.

@tsjensen tsjensen mentioned this issue Feb 17, 2021
@tsjensen tsjensen changed the title Support multi-byte character sets such as Unicode in config file Support multi-byte character sets in config file Feb 17, 2021
@tsjensen
Copy link
Member Author

tsjensen commented Apr 8, 2023

Just a small update on this topic. Things are slowly happening. The general roadmap tries to take the slow speed into consideration in order to avoid a feature branch that would need to live for years. It goes like this:

# Activity Status
1. Add black-box tests ✔️
2. Add unit tests
Now we can perform major refactorings while being reasonably sure we don't break too many things.
✔️
3. Add a bxstring module with a boxes abstraction for strings that can handle Unicode, invisible ANSI control characters, and characters that take up more than one column of text (bxstr_t). This makes use of libunistring. ✔️
4. Enable the parser to parse UTF-8 files, and put the data read to use in our code base.
When this is finished, the config file will be fully UTF-8 enabled, but you will still see only x instead of any non-ASCII character. Still, that's an important intermediate step.
✔️
5. The internal boxes logic would still work with ASCII, but upon output, we would print the Unicode / ANSI enabled real box. We now have Unicode support for creating boxes. ✔️
6. Add another test suite which applies the most common commands (create, mend, remove) to every design in the official config file ("sunny-day tests", as we use no special options). ✔️
7. Add Unicode support for the other commands (remove box, mend box, ...) ✔️
8. Get stuff to work on Windows. This is currently made difficult for lack of a proper terminal. Ideas? ✔️
9. Extensive updates to the documentation will be required. ✔️
10. Release a new version with all this. 🏃
11. Lots more internal refactoring, so that we natively work with bxstr_t * instead of char *. Changing the string abstraction in a program whose only purpose is wrangling strings is a major change. Some of this is already done (remove, detect).

[✔️ = done, 🏃 = in progress, ⌛ = planned]

I'll update this comment whenever something fundamental changes. Last update: 2023-12-25

@tsjensen tsjensen self-assigned this Apr 9, 2023
tsjensen added a commit that referenced this issue Apr 29, 2023
- shapes get additional MBCS values
- metadata is already converted for real to use bxstr_t*
tsjensen added a commit that referenced this issue Apr 29, 2023
- shapes get additional MBCS values
- metadata is already converted for real to use bxstr_t*
tsjensen added a commit that referenced this issue Apr 29, 2023
- shapes get additional MBCS values
- metadata is already converted for real to use bxstr_t*
tsjensen added a commit that referenced this issue Apr 30, 2023
- shapes get additional MBCS values
- metadata is already converted for real to use bxstr_t*
@tsjensen
Copy link
Member Author

The feature branch things are happening on is color-unicode. There are already a few test cases with colored unicode box designs, and it's working! We've had some delays because our code base didn't easily allow major refactorings. Currently, I feel we need some more test cases to be confident enough to release something. Also, properly supporting Windows will be an issue, and a lot of required cleanup.

But, it's coming along!

@tsjensen
Copy link
Member Author

2023-10-26_color-unicode

@tsjensen
Copy link
Member Author

Okay, we released v2.3.0 today with full UTF-8 support in config file! 🎉

Do give it a try!

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

1 participant