Bug 291279 - [Feature Request] Add UTF-8 Support to ee(1)
Summary: [Feature Request] Add UTF-8 Support to ee(1)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 15.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-29 13:23 UTC by ykla
Modified: 2026-03-02 14:19 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ykla 2025-11-29 13:23:46 UTC
As the default text editor shipped with the FreeBSD base system, ee(1) is extremely simple, intuitive, and helpful for out-of-the-box use, especially for newcomers or for quick system edits. However, one of its major limitations compared to editors such as nano is the lack of UTF-8 support.

At present, any Chinese characters or other non-ASCII text cannot be displayed correctly in ee(1). They are rendered as sequences such as “~~ MM MM MM M~ M~” or similar incorrect byte representations. This issue has been discussed in the community for a long time, but I could not find an existing feature request or open discussion in the FreeBSD bug tracker.

I also noticed that editors/microsoft-edit provides a simple, user-friendly editor with full UTF-8 support, and its license is compatible with the FreeBSD project. However, I understand the project currently does not intend to introduce Rust into the base system, so this option may not be feasible.

Given these constraints, I believe it would be valuable for FreeBSD to include at least one simple, UTF-8-capable text editor in the base system, whether by enhancing ee(1) or by adopting an alternative solution. For users working with multilingual environments, modern terminals, or UTF-8 locales, this would significantly improve usability and reduce friction.

Thank you for considering this request.
Comment 1 Marek Zarychta 2025-12-01 06:30:51 UTC
In the ports tree, we have editors/micro. This editor is also convenient for us, as its MIT license allows us to include it in FreeBSD; moreover, the project appears to be actively maintained [1].

1. https://github.com/zyedidia/micro
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2026-02-14 06:02:32 UTC
Would it be possible for you to try https://bapt.nours.eu/0001-Unicode-support.patch ?
Comment 3 Michael Osipov freebsd_committer freebsd_triage 2026-02-14 16:37:48 UTC
(In reply to Marek Zarychta from comment #1)

How, it requires Go and this means the Go toolchain needs to be part of the base system, no?
Comment 4 Marek Zarychta 2026-02-14 17:40:29 UTC
(In reply to Baptiste Daroussin from comment #2)
I am not the reporter, but I tried to do the test build, and it fails - we need better ncurses with wide character support in the base. 

/usr/src/contrib/ee/ee.c:665:15: error: call to undeclared function 'wget_wch'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
  665 |                         int wret = wget_wch(text_win, &win);
      |                                    ^
/usr/src/contrib/ee/ee.c:665:15: note: did you mean 'wgetch'?
/usr/include/curses.h:869:28: note: 'wgetch' declared here
Comment 5 Baptiste Daroussin freebsd_committer freebsd_triage 2026-02-15 20:12:34 UTC
which version of freebsd are you building on? this patch was made on current
Comment 6 Baptiste Daroussin freebsd_committer freebsd_triage 2026-02-16 12:18:17 UTC
https://reviews.freebsd.org/D55303 <= this version works fine for me
Comment 7 commit-hook freebsd_committer freebsd_triage 2026-02-17 11:51:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=62fba0054d9eb2303116f54be1f9bc0e7b75cc15

commit 62fba0054d9eb2303116f54be1f9bc0e7b75cc15
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-02-14 05:44:54 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-02-17 11:50:16 +0000

    ee: add unicode support

    - Add native support for unicode everywhere.
    - Remove Big5 specific code (and the menu entry)

    PR:             291279
    MFC After:      1 month
    Tested by:       Marek Zarychta
    Differential Revision:  https://reviews.freebsd.org/D55303

 contrib/ee/ee.c | 639 ++++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 408 insertions(+), 231 deletions(-)