MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack / isPartOfUTF8Sequence

Function isPartOfUTF8Sequence

src/java/containers/groovy_utils.go:115–122  ·  view source on GitHub ↗

isPartOfUTF8Sequence checks if a byte at position i is part of a valid UTF-8 sequence

(content []byte, i int)

Source from the content-addressed store, hash-verified

113
114// isPartOfUTF8Sequence checks if a byte at position i is part of a valid UTF-8 sequence
115func isPartOfUTF8Sequence(content []byte, i int) bool {
116 // Simple check: if byte has high bit set, it should be part of UTF-8
117 if content[i] >= 128 {
118 // Basic UTF-8 validation - this is a simplified check
119 return true
120 }
121 return false
122}
123
124// FindMainGroovyScript determines which Groovy script should be executed.
125// Following Ruby buildpack logic, a file is a candidate if it has a static

Callers 1

isValidGroovyFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected