[Nix-dev] How to get correct length of a string containing non-ascii characters

Erik Rybakken erik.rybakken at math.ntnu.no
Wed Jan 13 14:48:26 CET 2016


To anyone interested in this discussion, you may want to follow the
issue here: https://github.com/NixOS/nix/issues/770

There I wrote the reason I want this functionality. The main reason is
that I want to do as much as possible in Nix, instead of pushing stuff
to a building script.

Best,
Erik

On 2016-01-11 23:29, Erik Rybakken wrote:
> Hi,
> 
> In nix, when finding the length of a string containing non-ascii characters,
> the number of bytes in the representation is returned, instead of the actual
> number of characters:
> 
> > nix-repl> builtins.stringLength "å"
> > 2
> 
> Is there any way to get the number of characters instead, or does this
> require changes in the core language?
> 
> Best Regards,
> Erik Rybakken
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list