PageSourceSearch

https://dc-tools.cc/assets/TextBase64DecodeUtf8Tool-DC4S8rvU.js

js dc-tools.cc collected 2026-10-02 01:20:57 UTC 3,284 bytes, 1 lines download raw bytes

1import{r as n,j as e}from"./index-Cp6oVmJn.js";import{T as w}from"./ToolSeoSection-RrG1c4TM.js";import{g as C,r as E}from"./generatedTextTransforms-DWxAXewb.js";/* empty css                     */const p="text_base64_decode_utf8",S={name:"text"},y=[],T={},N={zh:{title:"Base64 UTF-8 解碼",subtitle:"將 Base64 還原成 UTF-8 文字,適合檢查設定值、測試資料與 API payload。",inputPlaceholder:"在此輸入或貼上內容...",processBtn:"開始處理",processing:"處理中...",copyBtn:"複製結果",downloadBtn:"下載結果",reset:"重置",empty:"請先輸入要處理的內容。",copied:"已複製"},en:{title:"Base64 UTF-8 Decoder",subtitle:"Decode Base64 into UTF-8 text for settings, fixtures, and API payload checks.",inputPlaceholder:"Enter or paste content here...",processBtn:"Process",processing:"Processing...",copyBtn:"Copy Result",downloadBtn:"Download Result",reset:"Reset",empty:"Enter content before processing.",copied:"Copied"}},R=i=>String(i).toLowerCase().startsWith("en")?N.en:N.zh;function F({language:i="zh"}){const[c,d]=n.useState(""),[u,x]=n.useState(T),[a,m]=n.useState(""),[g,l]=n.useState(""),[h,b]=n.useState(!1),s=R(i),j=n.useMemo(()=>c.trim().length>0,[c]),f=(t,o)=>{x(r=>({...r,[t]:o}))},B=()=>{if(!j){l(s.empty);return}b(!0);try{const t=E(p,{text:c,...u});m(t),l("")}catch(t){l(t.message||"Failed to process input.")}finally{b(!1)}},v=async()=>{a&&(await navigator.clipboard.writeText(a),l(s.copied))},P=()=>{if(!a)return;const t=new Blob([a],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=`${p}-result.txt`,r.click(),URL.revokeObjectURL(o)},U=()=>{d(""),x(T),m(""),l("")};return e.jsxs("div",{className:"tool-page",children:[e.jsxs("div",{className:"tool-page-content",children:[e.jsx("h1",{className:"tool-page-title",children:s.title}),e.jsx("p",{className:"tool-page-subtitle",children:s.subtitle}),e.jsxs("div",{className:"tool-page-body",children:[y.length>0&&e.jsx("div",{className:"tool-page-actions","aria-label":"Tool options",children:y.map(t=>e.jsxs("label",{style:{display:"grid",gap:"6px",minWidth:"180px"},children:[e.jsx("span",{className:"tool-page-stat-label",children:t.name}),e.jsx("input",{className:"tool-page-textarea",style:{minHeight:"auto",resize:"none"},type:"text",value:u[t.name]??"",onChange:o=>f(t.name,o.target.value)})]},t.name))}),e.jsx("textarea",{className:"tool-page-textarea",value:c,onChange:t=>d(t.target.value),placeholder:s.inputPlaceholder,"aria-label":S.name,rows:10}),e.jsxs("div",{className:"tool-page-actions",children:[e.jsx("button",{className:"tool-page-btn primary",onClick:B,disabled:!j||h,children:h?s.processing:s.processBtn}),a&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tool-page-btn secondary",onClick:v,children:s.copyBtn}),e.jsx("button",{className:"tool-page-btn secondary",onClick:P,children:s.downloadBtn}),e.jsx("button",{className:"tool-page-btn secondary",onClick:U,children:s.reset})]})]}),g&&e.jsx("p",{className:"tool-page-subtitle","aria-live":"polite",children:g}),a&&e.jsx("div",{className:"tool-page-result",children:e.jsx("textarea",{className:"tool-page-textarea output",value:a,readOnly:!0,rows:10,"aria-label":"result"})})]})]}),e.jsx(w,{seoData:C[p]})]})}export{F as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.