summaryrefslogtreecommitdiffstats
path: root/modules/charset
diff options
context:
space:
mode:
authorluzpaz <luzpaz@users.noreply.github.com>2022-07-12 17:32:37 -0400
committerGitHub <noreply@github.com>2022-07-12 23:32:37 +0200
commitd29d6d1991496cc688e9418db4960ca945fd9d6b (patch)
tree878dcc8a2c8621f9328d5093c6003d664d6fe9ed /modules/charset
parent966e7bdc9b875abb7192cd572beec40123a815da (diff)
downloadgitea-d29d6d1991496cc688e9418db4960ca945fd9d6b.tar.gz
gitea-d29d6d1991496cc688e9418db4960ca945fd9d6b.zip
Fix various typos (#20338)
* Fix various typos Found via `codespell -q 3 -S ./options/locale,./options/license,./public/vendor -L actived,allways,attachements,ba,befores,commiter,pullrequest,pullrequests,readby,splitted,te,unknwon` Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'modules/charset')
-rw-r--r--modules/charset/charset.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/charset/charset.go b/modules/charset/charset.go
index 89bbf1f8c9..a1210d2f05 100644
--- a/modules/charset/charset.go
+++ b/modules/charset/charset.go
@@ -23,7 +23,7 @@ import (
// UTF8BOM is the utf-8 byte-order marker
var UTF8BOM = []byte{'\xef', '\xbb', '\xbf'}
-// ToUTF8WithFallbackReader detects the encoding of content and coverts to UTF-8 reader if possible
+// ToUTF8WithFallbackReader detects the encoding of content and converts to UTF-8 reader if possible
func ToUTF8WithFallbackReader(rd io.Reader) io.Reader {
buf := make([]byte, 2048)
n, err := util.ReadAtMost(rd, buf)
@@ -76,7 +76,7 @@ func ToUTF8WithErr(content []byte) (string, error) {
return string(result), err
}
-// ToUTF8WithFallback detects the encoding of content and coverts to UTF-8 if possible
+// ToUTF8WithFallback detects the encoding of content and converts to UTF-8 if possible
func ToUTF8WithFallback(content []byte) []byte {
bs, _ := io.ReadAll(ToUTF8WithFallbackReader(bytes.NewReader(content)))
return bs
@@ -191,7 +191,7 @@ func DetectEncoding(content []byte) (string, error) {
break
}
- // Otherwise check if this results is earlier in the DetectedCharsetOrder than our current top guesss
+ // Otherwise check if this results is earlier in the DetectedCharsetOrder than our current top guess
resultPriority, resultHas := setting.Repository.DetectedCharsetScore[strings.ToLower(strings.TrimSpace(result.Charset))]
if resultHas && (!has || resultPriority < priority) {
topResult = result