Clarify encoding behavior in repository files API docs

What does this MR do?

Adds documentation notes to clarify that the content field in the repository files and blobs API endpoints may be transcoded to UTF-8 for non-UTF-8 files. This addresses user confusion when API responses don't match git clone or the UI Download button.

Specifically, this MR:

  • Updates doc/api/repository_files.md to note that for files not stored as valid UTF-8 (such as UTF-16 or latin-1):
    • content is transcoded to UTF-8 before Base64 encoding
    • size reflects the raw blob size, which may differ from the decoded content length
    • content_sha256 is computed from the transcoded content, not the raw blob
  • Updates doc/api/repositories.md with a similar note for the blobs endpoint
  • Points users to the /raw endpoints for retrieving exact Git blob bytes

#600568

Author's checklist

Reviewer's checklist

Documentation-related MRs should be reviewed by a Technical Writer for a non-blocking review, based on Documentation Guidelines and the Style Guide.

  • If the content requires it, ensure the information is reviewed by a subject matter expert.
  • Technical writer review items:
    • Ensure docs metadata is present and up-to-date.
    • Ensure the appropriate labels are added to this MR.
    • Ensure a release milestone is set.
  • Review by assigned maintainer.

Merge request reports

Loading
Loading