u/MonkeyNin

3,145 post karma · 66.1k comment karma · joined Jul 2012 · moderator

MonkeyNin

I found some claude tips to control things executed outside your profile. I'm updating answers here: gists: Fixing PS1 files utf8 encoded files with no BOM mark and Japanese culture.md

Claude plus Powershell with Japanese

try ~/.claude/settings.json

{
  "hooks": {
    "PreToolUse": "[Console]::InputEncoding = [System.Text.Encoding]::UTF8; [Console]::OutputEncoding = [System.Text.Encoding]::UTF8;"
  }
}

try CLAUDE.md

# Windows PowerShell Parameter Constraints
CRITICAL GLOBAL RULE: The host machine uses a Japanese system locale (CP932/Shift-JIS). 

Whenever you invoke external commands via the Windows PowerShell execution tool boundary that pass Japanese string arguments, you MUST prepend an explicit UTF-8 memory boundary wrapper. 

Never call parameters raw. Instead, format every shell invoke command like this:
powershell -NoProfile -Command "[Console]::InputEncoding = [System.Text.Encoding]::UTF8; [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; <Your-Command-Here>"

Another example used this:

# PowerShell Encoding Rules
CRITICAL: When generating, creating, or editing any Windows PowerShell script files (`.ps1` or `.psm1`) containing Japanese characters, you MUST explicitly write the file using "UTF-8 with BOM" (Byte Order Mark). Never save as raw UTF-8 without BOM, as it will crash the user's legacy PowerShell 5.1 parser on their Japanese locale machine.
MonkeyNin

/u/mrsonicmadness Did you recover all of your deleted files? If not, I wrote a script that converts the broken url into the archived ones.

I reversed their search. So you can query by deleted url instead of searching names.

Or you can use any language, even a curl. It's a raw, no-authentication, no-javascript method


Queries use apache solr. See this guide

Here's a template you can use as a base:

https://search.cdc.gov/srch/internet_archive/wcms_widget?fl=title,date_archived,date_archived_display,original_url,archive_url,excerpt_txt,cdc_sys_lang_str,cdc_topic_str,cdc_topic_srch&fq=original_url:%22<original_url>%22