Add encoding validation, fix scripts, and encoding docs
This commit is contained in:
@@ -92,6 +92,34 @@ Set via environment variables or edit `config.py`:
|
||||
| `DS_DEVICE` | `cpu` | `cpu` or `cuda` |
|
||||
| `DS_COMPUTE` | `int8` | `int8`, `float16`, `float32` |
|
||||
| `DS_KEEP_AUDIO` | `0` | Keep MP3s after transcription (`1` to keep) |
|
||||
| `DS_ENCODING_CHECK` | `50` | Episodes between UTF-8 verification |
|
||||
|
||||
## Encoding & Character Handling
|
||||
|
||||
All JSON files are written as **UTF-8** with `ensure_ascii=False`. The RSS feed contains Unicode characters (em/en dashes, accented characters) which are preserved correctly in the JSON files.
|
||||
|
||||
**If you see mojibake like `â€"` or `é`:**
|
||||
- The JSON files are correctly stored as UTF-8
|
||||
- The issue is the *consumer* (text editor, web browser, terminal) reading the file with wrong encoding (Latin-1/Windows-1252)
|
||||
- **Fix**: Ensure your tools/editor/browser use UTF-8 encoding
|
||||
|
||||
**Verification & Repair:**
|
||||
```bash
|
||||
# Verify all JSON files are valid UTF-8
|
||||
python verify_encoding.py
|
||||
|
||||
# Fix common mojibake patterns (run if data was corrupted)
|
||||
python fix_mojibake.py --dry-run # preview fixes
|
||||
python fix_mojibake.py # apply fixes
|
||||
|
||||
# Check progress including encoding status
|
||||
python check_progress.py
|
||||
```
|
||||
|
||||
**For web apps displaying this data:**
|
||||
- Set `Content-Type: application/json; charset=utf-8`
|
||||
- Include `<meta charset="utf-8">` in HTML
|
||||
- Ensure database connections use UTF-8
|
||||
|
||||
## Resuming / Sharing Work
|
||||
|
||||
|
||||
Reference in New Issue
Block a user