Hi,
I just realized that UTF-8 characters aren't supported as word
delimiters. The attached patch fixes this issue.
For a higher usefulness of the utf8strchr function, the index of the
UTF-8 character could be returned in addition with a Rune instead of a
char*. Since utf8strchr is currently
For what it's worth, I agree with this approach. uint32_t is
guaranteed (since C99) to be just the right size to hold all Unicode
points (as well as their UTF-8 representation) without wasting (too
much) space.
But uint32_t is not guaranteed to be present in all the implementations,
On 4 May 2015 at 11:30, Roberto E. Vargas Caballero k...@shike2.com wrote:
But uint32_t is not guaranteed to be present in all the implementations
uint32_t is guaranteed in POSIX 2004, but you may not want to rely on that.
uint32_least_t, which would suffice, is guaranteed in C99.
cls
Applied (with minor changes), thanks.
On April 27, 2015 9:58:37 AM CEST, Roberto E. Vargas Caballero
k...@shike2.com wrote:
GCC and Clang define long as 64-bits by default for x86_64, AArch64,
and many other 64-bit target architectures, which is wasteful for
Unicode code points.
Uhmmm, so do you propose don't use long arrays
On Mon, Apr 27, 2015 at 10:05 AM, koneu kone...@googlemail.com wrote:
On April 27, 2015 9:58:37 AM CEST, Roberto E. Vargas Caballero
k...@shike2.com wrote:
GCC and Clang define long as 64-bits by default for x86_64, AArch64,
and many other 64-bit target architectures, which is wasteful for
GCC and Clang define long as 64-bits by default for x86_64, AArch64,
and many other 64-bit target architectures, which is wasteful for
Unicode code points.
Uhmmm, so do you propose don't use long arrays ever? because in
some implementations long may be 4, but in others may be
8. We also
On Mon, Apr 27, 2015 at 09:58:37AM +0200, Roberto E. Vargas Caballero wrote:
Uhmmm, so do you propose don't use long arrays ever? because in
some implementations long may be 4, but in others may be
8. We also should forbid int arrays for the same reason.
I would say it depends on the context.
On Tue, Apr 21, 2015 at 09:28:38PM +, noname wrote:
typedef struct {
- char c[UTF_SIZ]; /* character code */
- ushort mode; /* attribute flags */
- uint32_t fg; /* foreground */
- uint32_t bg; /* background */
+ long u; /* character code */
+
---
st.c | 79 +---
1 file changed, 38 insertions(+), 41 deletions(-)
diff --git a/st.c b/st.c
index 0c31fc5..fa21c4e 100644
--- a/st.c
+++ b/st.c
@@ -72,6 +72,7 @@ char *argv0;
#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) ==
10 matches
Mail list logo