fix version startup and imported encodings - #42
Merged
Conversation
matveynator
marked this pull request as ready for review
July 30, 2026 20:26
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
--version,-version, and-vinvocations before storage-path and server flag initializationutf8mb4_unicode_ci<meta>tags, leaving JavaScript/JSON text untouchedRoot cause
https://kmv.ru/for-home.htmlcurrently returns 170,977 valid UTF-8 bytes and declares UTF-8 in both HTTP and HTML metadata. The old whole-document scoring still selected KOI8-U because its length-dependent score outweighed the fixed UTF-8 preference, turningДля домаintoп■п╩я▐.Separately, NetChan started its logging goroutine from package
init, so it ran before SiteBrush could process--version.User impact
Version commands now print exactly one version line with no SiteBrush storage creation or NetChan startup log. Large UTF-8 pages retain their original text, legacy Cyrillic fallbacks remain supported, and charset-like strings embedded in scripts are no longer modified.
Checks
GOCACHE=/private/tmp/sitebrush-gocache go test ./pkg/...GOCACHE=/private/tmp/sitebrush-gocache go test ./pkg/crawler -count=1GOCACHE=/private/tmp/sitebrush-gocache go vet ./pkg/crawlerencoding=utf-8 source=http certain=true expected_text=true mojibake=false bytes=170977version-live-checkfor all three version flagsgit diff --checkThe full root suite has the same nine pre-existing failing tests on this branch and clean
origin/main; no additional failing test was introduced.