-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
Consider the following:
in := "\xff-\xff"
sep := ""
fmt.Printf("%q\n", bytes.Split([]byte(in), []byte(sep))) // ["\xff" "-" "\xff"]
fmt.Printf("%q\n", strings.Split(string(in), string(sep))) // ["�" "-" "\xff"]The results of these two are inconsistent where the strings implementation replaced
\xff with utf8.RuneError, even though the documentation of strings.Split
mentions no such behavior. It only says that it slices up the input.
Furthermore, it is odd, that it only mangles the first element of the result, but not the last.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.