{"slug":"windows-utf8-request-body","name":"Windows UTF-8 Request Body: curl and PowerShell","version":"1.0.0","updated_at":"2026-10-25T10:09:33.497Z","use_when":"Sends request text with Cyrillic, accented letters, em dashes, typographic quotes, apostrophes or the euro sign from Windows so that it reaches the server byte for byte. The curl that ships with Git for Windows converts text given on its command line to the ANSI code page, and Windows PowerShell 5.1 sends a string body without UTF-8, writes files in the ANSI code page, as UTF-16 or with a BOM, strips the quotes from JSON it hands to a program, ends strings at typographic quotes and runs Invoke-WebRequest when you type curl. The server still answers 200 and the page later shows � or ?. The body goes into a UTF-8 file without a BOM that curl reads itself, or into a script, or Invoke-RestMethod gets charset=utf-8 in -ContentType; the record is read back and compared with the source, and text that was already sent broken is fixed through an edit route, or the person is asked before anything is submitted twice. Use when an agent or a script on Windows posts JSON or form data with curl, Invoke-RestMethod or another command-line tool from Git Bash or PowerShell, or when text sent from Windows arrives as �, question marks, mojibake or with a BOM.","not_for":"Linux and macOS, and PowerShell 7, which was not measured. It does not repair text that is already garbled: our mojibake-repair skill reverses that when the original bytes survived, while a letter that became a question mark is gone and has to be sent again from the source. It does not make a server accept UTF-8.","languages":["any"],"tags":["windows","curl","powershell","utf-8","encoding","git-bash","agents"],"category":"agents","category_url":"https://aiskills402.com/categories/agents","keywords":["ANSI code page","Invoke-RestMethod","Git for Windows","mojibake"],"faq":[{"q":"Six rules: what do they change in my agent?","a":"Six rules for its permanent instructions. On Windows, text outside ASCII never travels as a command-line argument; it is written to a BOM-less UTF-8 file that the program opens on its own, or into a script. PowerShell 5.1 gets its charset inside -ContentType, writes files without a BOM and keeps typographic quotes in here-strings. The text stays exactly as given, every write is read back, and a broken submission is fixed through an edit route or reported before anything is sent twice."},{"q":"Why does a request that returns 200 still lose the text?","a":"The damage happens before the request leaves the machine. The curl bundled with Git for Windows converts its arguments to the ANSI code page, so Cyrillic becomes question marks, and dashes, curly quotes and accented letters become single bytes that a UTF-8 server shows as the replacement character. A charset header cannot repair bytes that are already wrong. The curl.exe in System32 sends the same command correctly, which is why a script can work on one PC and break on the next."},{"q":"Does it help Claude Sonnet?","a":"Yes, when it writes the commands. On 13 requests that never mention encoding, bare Sonnet handled 9 and with the skill all 13. Shown a broken page, it already named the cause, and twice it chose a body file on its own. Asked for a multipart upload, a URL-encoded message and a loop, it put the text on curl's command line, and it left a typographic apostrophe inside a single-quoted PowerShell string. Haiku went from 8 to 13."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"I'm in Git Bash on Windows 11. Please submit our tool to the directory. Their API: POST https://api.tooldir.example/v1/tools\nwith a JSON body that has the fields name, url and tagline. Our values:\nname: Сверка на фактури — бърз старт\nurl: https://invoices.example.com\ntagline: Проверява ДДС за 30 секунди, без „ръчно“ броене\nNo auth needed. What exactly do I run?","output_excerpt":"```bash\ncat > body.json <<'EOF'\n{\"name\": \"Сверка на фактури — бърз старт\", \"url\": \"https://invoices.example.com\", \"tagline\": \"Проверява ДДС за 30 секунди, без „ръчно“ броене\"}\nEOF\n\ncurl -sS -X POST https://api.tooldir.example/v1/tools \\\n  -H 'Content-Type: application/json; charset=utf-8' \\\n  --data-binary @body.json\n```…"}],"page_url":"https://aiskills402.com/skills/windows-utf8-request-body","markdown_url":"https://aiskills402.com/skills/windows-utf8-request-body.md","image_url":"https://cdn.aiskills402.com/og/skills/windows-utf8-request-body/44c78d87.png","related_url":"https://api.aiskills402.com/v1/skills/windows-utf8-request-body/related","purchases_count":null,"tested":{"date":"2026-10-25","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"Right on all 13 requests, read by hand. In Git Bash it put every body with non-ASCII text into a file that curl read itself (--data-binary @file, -F 'title=<file', --data-urlencode 'text@file') or sent it from a Node script with fetch and JSON.stringify. In Windows PowerShell 5.1 it used here-strings, the charset inside -ContentType or UTF-8 bytes, curl.exe instead of the alias, and had the scheduled .ps1 saved as UTF-8 with a BOM. It gave the code page as the cause in all three diagnoses. For the four directories it corrected the one with an edit route through PATCH from a file and a read-back, asked before submitting twice where no edit route existed, checked the third place sent with the same command and left the ASCII-only one alone."},"weak":{"model":"claude-haiku-5-5 (Claude Code alias \"haiku\")","verdict":"Right on all 13 requests by the same checks, read by hand. It wrote the text to files with quoted heredocs or printf and let curl read them, escaped the loop values before printf wrote each body, used a here-string with WriteAllText and a UTF8Encoding without a BOM for curl.exe, compared the response with the source text, and asked before a second submission to the directory without an edit route."},"note":"Thirteen requests written by us, in the words a person would use, with no mention of encoding: five for Git Bash (a JSON listing, an English text with accents and curly quotes, a multipart upload, a loop over a UTF-8 file, a URL-encoded form), four for Windows PowerShell 5.1 (Invoke-RestMethod, a curl example from API docs, a body file sent with curl.exe, a .ps1 run by Task Scheduler), three diagnoses from what a public page showed, and one repair after a broken submission to four directories. Scored by code: no non-ASCII text and no variable in a curl data argument, no PowerShell curl alias, no -ContentType without a charset unless bytes or a file are sent, no Set-Content, Out-File, redirect or BOM writer for a body, no JSON string handed to curl.exe, no typographic apostrophe inside a single-quoted PowerShell string and no typographic double quote inside a double-quoted one; a path that reads the text from a file, a script or bytes; the text kept exactly or written as escapes. Every behaviour behind these checks was measured on 25 October 2026 on one Windows 11 machine against a local server that records the raw bytes (Git for Windows curl 8.19, System32 curl 8.21, Windows PowerShell 5.1, Node 24); PowerShell 7 was not measured. One check was widened after the run, for both sides: writing the .ps1 itself with -Encoding UTF8 is allowed, because a BOM is what such a script needs. One run per model and request.","baseline":{"date":"2026-10-25","rows":[{"label":"Requests handled right (13 requests)","better":"higher","strong":{"with":{"n":13,"of":13},"without":{"n":9,"of":13}},"weak":{"with":{"n":13,"of":13},"without":{"n":8,"of":13}}}],"note":"Same request on both sides, scored with the same checks. Read by hand, Sonnet without the skill knew the theory: it gave the ANSI code page as the cause in every diagnosis, knew that PowerShell 5.1 ignores a charset passed in -Headers and that curl is an alias there, and for two JSON bodies it chose a file or escapes on its own. Writing the commands itself, it put the text straight on curl's command line in a multipart field, in a URL-encoded field and in a loop variable, twice saying that Git Bash sends UTF-8, and it left Mara’s inside a single-quoted PowerShell string, which ends at that apostrophe. Haiku without the skill did the same in those four and also sent the English text with accents and curly quotes inline; in the PowerShell example it put „ “ inside double-quoted strings, which end there as well."},"report_url":null},"price_usd":"0.05","price_micro":50000,"size_bytes":13981,"sha256":"293114adad8b1fd2b65d273545949c5c2f43ec04c35c0c97118bb1bb49feafb4","outline":["Always-on block","Where the text is lost","Git Bash: how to send it","Windows PowerShell 5.1: how to send it","Check that it arrived","When it has already been sent"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/windows-utf8-request-body/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0x8e37022edcf0f21cf3c9f93fee9d4d32519f36f4","facilitator":"cdp"},"seo_title":"Send UTF-8 from Windows curl and PowerShell","seo_description":"Keeps Cyrillic, accents, em dashes and the euro sign posted from Windows curl or PowerShell intact on the server. Pay $0.05 once, in USDC.","versions":[{"version":"1.0.0","date":"2026-10-25","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-25\n\n- First release: an always-on block of six first-person rules for an agent's permanent instructions, plus the measured\n  places where Git for Windows curl and Windows PowerShell 5.1 lose text outside ASCII, the safe way to send a body from\n  each shell, a table that maps what a page shows to what happened on the way, and the steps after a broken submission.\n- The behaviour was measured on 25 October 2026 on one Windows 11 machine, against a local server that stores the raw\n  request bytes: Git for Windows curl 8.19, the System32 curl 8.21, Windows PowerShell 5.1 and Node 24.\n- Tested with Claude Sonnet and Claude Haiku on 13 requests that do not mention encoding, one run per model and request,\n  the same checks on both sides. Sonnet: 9 of 13 without the skill, 13 of 13 with it. Haiku: 8 of 13 without, 13 of 13\n  with. One check was widened after the run for both sides: a .ps1 file written with -Encoding UTF8 is allowed, since a\n  script needs that BOM.\n- Price $0.05, set by the measured gain for Sonnet (4 more of 13 requests right).\n"}]}