Skip to content

Commit

Permalink
Add utf8proc for handling character properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas committed May 21, 2018
1 parent cd106d3 commit 29524d0
Show file tree
Hide file tree
Showing 12 changed files with 16,101 additions and 796 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ COMPAT_CPPFLAGS += -DNO_WORDEXP
COMPAT_OBJS += compat/wordexp.o
endif

COMPAT_OBJS += compat/hashtab.o compat/wcwidth.o
COMPAT_OBJS += compat/hashtab.o compat/utf8proc.o

override CPPFLAGS += $(COMPAT_CPPFLAGS)

Expand Down Expand Up @@ -320,7 +320,7 @@ src/tig: $(TIG_OBJS)
TEST_GRAPH_OBJS = test/tools/test-graph.o src/string.o src/util.o src/io.o $(GRAPH_OBJS) $(COMPAT_OBJS)
test/tools/test-graph: $(TEST_GRAPH_OBJS)

DOC_GEN_OBJS = tools/doc-gen.o src/string.o src/types.o src/util.o src/request.o compat/wcwidth.o
DOC_GEN_OBJS = tools/doc-gen.o src/string.o src/types.o src/util.o src/request.o $(COMPAT_OBJS)
tools/doc-gen: $(DOC_GEN_OBJS)

OBJS = $(sort $(TIG_OBJS) $(TEST_GRAPH_OBJS) $(DOC_GEN_OBJS))
Expand Down
1 change: 1 addition & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Improvements:
- Support running Tig via a Git alias. (GH #763)
- Use ISO-8601 letters for short relative dates. (GH #759)
- Change date formatting to show timezones by default. (GH #428, #811)
- Use utf8proc to handle Unicode characters. (GH #827)

Bug fixes:

Expand Down
Loading

2 comments on commit 29524d0

@koutcher
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one pretty much doubles the size of tig executable, hope it's worth it...

@jonas
Copy link
Owner Author

@jonas jonas commented on 29524d0 May 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your concern. That's 300kB less to store XML and an occasional MP3. Once Unicode will add more turd emojis the move to utf8proc will clearly be worth it since it will be trivial to regenerate and update.

Seriously though, I am not an expert in Unicode support but found utf8proc to be a great library; simple API, easy to embedded, fairly complete (Unicode 10.0.0 currently supported). It might still make sense to look into making it optional in favour of libicu (see #722), but in terms of return of investment I hope it will pay off to have good Unicode support offered without dependencies.

Please sign in to comment.