Track bundled vendor runtime sources
This commit is contained in:
14
vendor/Agent-Reach/agent_reach/utils/text.py
vendored
Normal file
14
vendor/Agent-Reach/agent_reach/utils/text.py
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"""UTF-8-safe text helpers for cross-platform file operations."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def read_utf8_text(path: str | Path, default: str = "") -> str:
|
||||
"""Read text as UTF-8 with replacement semantics."""
|
||||
|
||||
target = Path(path)
|
||||
if not target.exists():
|
||||
return default
|
||||
return target.read_text(encoding="utf-8", errors="replace")
|
||||
Reference in New Issue
Block a user