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

add `string lower` and `string upper` #4080

Closed
krader1961 opened this Issue May 30, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@krader1961
Contributor

krader1961 commented May 30, 2017

I was working on a proof of concept implementation to support zsh style tied variables to address issue #436. But I found myself needing a way to lowercase a string. Now that we have a string builtin it shouldn't be necessary to run an external command like tr to do this operation.

@krader1961 krader1961 added this to the fish 2.7.0 milestone May 30, 2017

@krader1961 krader1961 self-assigned this May 30, 2017

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Jun 11, 2017

Member

This doesn't do full unicode locale-aware uppercasing:

$ string toupper "aßb"
AßB

(which should be "ASSB" if the locale is de_DE.UTF-8)

This is okay (this functionality is unlikely to be used and brings with it a bunch of issues), but should probably be documented.

Member

faho commented Jun 11, 2017

This doesn't do full unicode locale-aware uppercasing:

$ string toupper "aßb"
AßB

(which should be "ASSB" if the locale is de_DE.UTF-8)

This is okay (this functionality is unlikely to be used and brings with it a bunch of issues), but should probably be documented.

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Jun 11, 2017

Member

See also #2241.

Member

zanchey commented Jun 11, 2017

See also #2241.

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Jun 11, 2017

Contributor

This doesn't do full unicode locale-aware uppercasing.

Correct. But that's true of all the non-ASCII handling within fish. The only feasible way to fix it is to use the ICU or Boost libraries.

Contributor

krader1961 commented Jun 11, 2017

This doesn't do full unicode locale-aware uppercasing.

Correct. But that's true of all the non-ASCII handling within fish. The only feasible way to fix it is to use the ICU or Boost libraries.

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Jun 11, 2017

Member

git revert 0d64bbed46f07f78a24449139d11e7fafe968e4e? 😂

Member

zanchey commented Jun 11, 2017

git revert 0d64bbed46f07f78a24449139d11e7fafe968e4e? 😂

@floam

This comment has been minimized.

Show comment
Hide comment
@floam

floam Jul 26, 2017

Member

Am I crazy or should it be possible with the STL in C++?

https://stackoverflow.com/a/17993266

Member

floam commented Jul 26, 2017

Am I crazy or should it be possible with the STL in C++?

https://stackoverflow.com/a/17993266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment