Adam S
05/09/2024, 1:23 PMBufferedSource.select()
and TypedOptions
. It seems like the options selects the shortest match,. E.g. when a source starts with fffe0000
it will always select the fffe
option, but I want it to select fffe0000
.
I can implement something manually, but I wanted to check first: is this the intended behaviour?jw
05/09/2024, 3:13 PMlunch"
and lunchbox"
allowing the closing quote to force the prefix to otherwise no longer be a prefix.jw
05/09/2024, 3:13 PMjessewilson
05/10/2024, 2:36 AMjessewilson
05/10/2024, 2:39 AMprivate val UnicodeBomOptions: TypedOptions<CharEncoding> =
TypedOptions.of(CharEncoding.entries.sortedBy { it.bom }.reversed()) {
when (it) {
CharEncoding.UTF_8 -> it.bom
CharEncoding.UTF_16BE -> it.bom
CharEncoding.UTF_16LE -> it.bom
CharEncoding.UTF_32BE -> it.bom
CharEncoding.UTF_32LE -> it.bom
}
}
jessewilson
05/10/2024, 2:39 AMjw
05/10/2024, 2:41 AMjw
05/10/2024, 2:42 AMjw
05/10/2024, 2:43 AMjw
05/10/2024, 2:45 AMjessewilson
05/10/2024, 3:12 AMjessewilson
05/10/2024, 3:13 AMjw
05/10/2024, 3:13 AMjw
05/10/2024, 3:13 AMjessewilson
05/10/2024, 3:14 AMFE FF
jw
05/10/2024, 3:15 AMjessewilson
05/10/2024, 3:16 AMjessewilson
05/10/2024, 3:17 AMjw
05/10/2024, 3:18 AMAdam S
05/10/2024, 8:06 AMSort your options by the order you’d prefer the match to be inAhhhh right, sort the enum entries! That works, thanks!
Adam S
05/10/2024, 8:09 AMAdam S
05/10/2024, 8:29 AMjw
05/10/2024, 12:01 PM