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

weechat uses libc's wcswidth #79

Closed
ghost opened this issue May 8, 2014 · 22 comments
Closed

weechat uses libc's wcswidth #79

ghost opened this issue May 8, 2014 · 22 comments
Assignees
Labels
bug Unexpected problem or unintended behavior won't fix This will not be implemented/fixed

Comments

@ghost
Copy link

ghost commented May 8, 2014

Weechat uses the libc's wcswidth, which is implemented in terms of the libc's wcwidth, typically. Unfortunately, glibc's wcwidth is rather out of date and therefore untrustworthy. weechat should, instead, import mgk25's wcwidth/wcswidth implementations. I believe this will permit weechat to support Unicode more correctly.

@flashcode
Copy link
Member

flashcode commented May 8, 2014

We discussed some hours ago about UTF-8 problems in WeeChat, about this answer: http://stackoverflow.com/questions/23526353/how-to-get-ncurses-to-output-astral-plane-unicode-characters/ (the source code example in this question is from me).
So according to the answer, the problem is not in WeeChat, but in glibc.
What would be the benefit of using your mgk25's wcwidth?

@godeater
Copy link

godeater commented May 8, 2014

I can confirm that using the method in the answer for modifying your locale works perfectly too. I've now added a further 1000 or so code points to my locale using it, and weechat is rendering them fine now :

image

@ghost
Copy link
Author

ghost commented May 8, 2014

Okay, sure. I'm just commenting about this based on the observation that wee-utf8.c uses glibc's wcswidth, which is dependent on glibc's wcwidth and is therefore broken. mgk25's version is more up to date, and includes documentation on how to keep it up to date as new Unicode standards are released--which is important, because glibc is clearly not keeping up.

@flashcode
Copy link
Member

flashcode commented May 10, 2014

If glibc is broken, then why not fixing it?
I know it could be hard, but then all programs using it will be fixed, it's IMHO better than using other implementations.

@ghost
Copy link
Author

ghost commented May 10, 2014

It is not possible to fix glibc and ensure the fix is available everywhere.
By carrying a solution which does not rely on glibc, weechat can ensure it
is correct everywhere it compiles, without having to trust the libc to be
up to date. Besides, wcwidth does not guarantee that its results are
compliant with any particular standard, so it is technically correct for it
to behave in a manner we would construe to be misbehaviour.

On Sat, May 10, 2014 at 12:32 AM, Sébastien Helleu <notifications@github.com

wrote:

If glibc is broken, then why not fixing it?
I know it could be hard, but then all programs using it will be fixed,
it's IMHO better than using other implementations.


Reply to this email directly or view it on GitHubhttps://github.com//issues/79#issuecomment-42732388
.

@flashcode flashcode added the bug label May 25, 2014
@kyrias
Copy link

kyrias commented Sep 17, 2014

A person has started working on updating glibc's locale data (bug report), tho one person has reported that he couldn't apply the patch. But at least it's being worked on.

@flashcode
Copy link
Member

flashcode commented Oct 15, 2014

Definitely a glibc bug, not WeeChat. And it looks like they're working on the problem, so I close this issue.

@flashcode flashcode self-assigned this Nov 16, 2014
@flashcode flashcode added the won't fix This will not be implemented/fixed label Nov 16, 2014
@flashcode
Copy link
Member

flashcode commented May 22, 2015

Here's a post with a workaround: https://blog.nytsoi.net/2015/05/04/emoji-support-for-weechat

@ghost
Copy link
Author

ghost commented May 22, 2015

Yup, but that's basically just externalizing the workaround I opened this bug to offer.

@kaniini
Copy link

kaniini commented May 22, 2015

It should be fixed in glibc. Overriding wcswidth (or any other libc symbol) is undefined behaviour and otherwise creates unnecessary maintenance burden.

@Mikaela
Copy link
Contributor

Mikaela commented May 23, 2015

I believe this is fixed in glibc 2.22, but too recent glibc to be in any distribution yet.

Changed 2.21 to 2.22 based on the following comment.

@kyrias
Copy link

kyrias commented May 23, 2015

It was committed after the 2.21 release, but should be fixed in the next one.

@Earnestly
Copy link

Earnestly commented Sep 13, 2015

This is fixed in glibc.

Don't blame glibc versions, blame your distro for using outdated versions. I've been running glibc from git for awhile without issue. Most distributions are just bad and insecure.

As an addendum, weechat did the right thing here. It should never have used its own implementation of wcwidth (/me looks at konsole), this is distinctly the job of the libc and should be fixed there (which it was). Many thanks to Alexandre Oliva and Mike FABIAN for this work.

trains

@flashcode
Copy link
Member

flashcode commented Sep 13, 2015

@Earnestly: not really related, but maybe you have an idea for this problem? #258 (comment)

@dustymabe
Copy link

dustymabe commented Jan 16, 2019

For some reason I'm having issues getting emojis to display in weechat. I'm running on fedora which has a recent glibc:

[root@94c1542b0fbd ~]# rpm -q weechat glibc google-noto-emoji-color-fonts
weechat-2.2-1.fc29.x86_64
glibc-2.28-26.fc29.x86_64
google-noto-emoji-color-fonts-20180814-1.fc29.noarch

is it required for me to grab one of the weechat emoji plugins to get this to work?

@weechatter
Copy link
Contributor

weechatter commented Jan 17, 2019

none of the weechat emoji scripts will fix display bugs. Maybe its a font issue

@dustymabe
Copy link

dustymabe commented Jan 17, 2019

none of the weechat emoji scripts will fix display bugs. Maybe its a font issue

thanks. it seems to be working now (not sure what changed since yesterday). emojis are showing up in IRC. The only issue I have now is that emojis aren't showing up in slack (weeslack plugin). I'll see if I can figure out what is going on there.

Thanks again @weechatter

@birdayz
Copy link

birdayz commented Jan 27, 2019

@dustymabe i'm having the same issues with slack, did you figure out the cause?

@dustymabe
Copy link

dustymabe commented Jan 28, 2019

@dustymabe i'm having the same issues with slack, did you figure out the cause?

no luck with figuring it out before my free time ran out :(

@trygveaa
Copy link
Contributor

trygveaa commented Jan 28, 2019

@dustymabe, @birdayz: wee-slack doesn't show emojis, only text representations (like :smile:), because that's what it receives from the server. It's on my (long) todo list to implement some translation, but not sure when I'll get it done. If you have any issues, feel free to open an issue in https://github.com/wee-slack/wee-slack.

@dustymabe
Copy link

dustymabe commented Jan 28, 2019

It's on my (long) todo list to implement some translation

thanks @trygveaa! Is there an issue we can subscribe to to follow the progress of that feature?

@trygveaa
Copy link
Contributor

trygveaa commented Jan 28, 2019

@dustymabe: wee-slack/wee-slack#465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior won't fix This will not be implemented/fixed
Projects
None yet
Development

No branches or pull requests

10 participants