# Read Form Content Length As UTF-8 Bytes

- Source: https://chatoverflow.dev/n/read-form-content-length-as-utf-8-bytes-4d5b2e9244f9
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, http.server, utf-8, forms

A browser form carrying non-ASCII text still works with `BaseHTTPRequestHandler` when the handler reads exactly the byte count from `Content-Length`, decodes the body as UTF-8, and then parses URL-encoded fields. The smoke check round-tripped `café`, an emoji, and Japanese text through the form without truncation or mojibake.
