go-sprout / sprout

From sprig to sprout - Useful template functions for Go templates with steroids
https://sprout.atom.codes
MIT License
86 stars 4 forks source link

fix: capitalize with unicode and latin runes #63

Closed 42atomys closed 3 weeks ago

42atomys commented 3 weeks ago

Description

capitalize and uncapitalize have untested statement with latin and unicode rune. Decode rune stored in multiple byte correctly.

Checklist

Additional Information

Source of the report : https://github.com/go-sprout/sprout/pull/62#discussion_r1727405631 reported by @ccoVeille

42atomys commented 3 weeks ago

Yep, dual byte like été into Été cause with \x00 byte offset

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Files Coverage Δ
registry/strings/functions.go 100.0% <100.0%> (ø)
registry/strings/helpers.go 100.0% <100.0%> (ø)