⬅️ 左侧填充 UnicodeLeft Pad Unicode
在每一行左侧补填充字符,直到达到指定宽度(默认按显示列:中日韩文字和 Emoji 占 2 列);超长的行默认原样保留。本地处理。Pad every line on the left with a fill character up to a target width (display columns by default: CJK and emoji count as 2); longer lines are kept as they are unless you choose to truncate. Processed locally.
使用说明与常见问题How-to & FAQ
「左侧填充 Unicode」是什么?What is the Left Pad Unicode tool?
在每一行左侧补填充字符,直到达到指定宽度(默认按显示列:中日韩文字和 Emoji 占 2 列);超长的行默认原样保留。本地处理。Pad every line on the left with a fill character up to a target width (display columns by default: CJK and emoji count as 2); longer lines are kept as they are unless you choose to truncate. Processed locally.
如何使用「左侧填充 Unicode」?How do I use the Left Pad Unicode tool?
在「左侧填充 Unicode」中,把内容粘贴或输入到上方输入框,按需设置「宽度」、「填充字符(默认 · 空格)」、「宽度模型」,结果会实时显示在下方,点击「复制结果」即可复制。In the Left Pad Unicode: Paste or type into the input box, adjust "Width", "Pad char (default · space)", "Width model"; the result appears below instantly — click "Copy result" to copy it.
宽度怎么算?How is the width counted?
默认按东亚宽度(East Asian Width)算显示列:中日韩文字、全角字符和 Emoji 各占 2 列,组合附加符和零宽字符占 0 列,其余字符占 1 列,适合等宽字体(和“居中 Unicode”用的是同一套规则)。把“宽度模型”改成“字素”则每个看到的字符都算 1。By default the width is counted in display columns using East Asian Width: CJK characters, fullwidth forms and emoji take 2 columns, combining marks and zero-width characters take 0, and everything else takes 1, which suits monospaced fonts (the same rule as Center Unicode). Set Width model to Graphemes to count every visible character as 1.
填充字符可以是中文或 Emoji 吗?Can the pad character be Chinese or an emoji?
可以,取你输入的第一个字素。按显示列计算时它占 2 列,如果剩下奇数列,最后 1 列用空格补齐,结果下方会提示。默认填充字符是空格。Yes, the first grapheme you type is used. Under display columns it takes 2 columns, so if an odd column is left over it is filled with a space and a note says so. The default pad character is a space.
比宽度长的行会被截断吗?Are lines longer than the width cut?
默认不会:超长的行原样保留,并在结果下方提示有几行;只有勾选“截断超长行”时才截到指定宽度。多行文本每一行都单独处理,空行会被补满;输入框完全为空时不输出,想得到一整行填充字符可以只输入一个换行。Not by default: longer lines are kept as they are and a note below the result says how many. They are cut only when you tick Truncate long lines. Every line of multi-line text is handled separately, and blank lines are filled completely. A completely empty box gives no output; to get one full line of padding, enter just a line break.
什么是字素(字素簇)?What is a grapheme (grapheme cluster)?
字素(字素簇)就是看到的一个字符,它可能由好几个码位组成:例如 é 可以是 e 加一个组合重音符,👨👩👧 是用零宽连接符连起来的 5 个码位,🇹🇼 是两个区域指示符。本页按 Unicode 规则(UAX #29,即浏览器的 Intl.Segmenter)切分字素,所以这些都算 1 个,不会被拆开。A grapheme (grapheme cluster) is one user-perceived character, which can be made of several code points: é can be e plus a combining accent, 👨👩👧 is five code points joined by zero-width joiners, and 🇹🇼 is two regional indicators. This page splits graphemes with the Unicode rules (UAX #29, the browser's Intl.Segmenter), so each of these counts as 1 and is never broken apart.
输入和输出是什么样的?What does the input and output look like?
例如输入 hi,「宽度」设为 5,输出为“ hi”:左边补了 3 个空格(这里用 · 表示:···hi)。「填充字符」设为 0 时输出 000hi。For example, hi with Width 5 gives " hi": three spaces are added on the left (shown here as ···hi). With Pad char 0 the result is 000hi.
有哪些选项可以调整?What options can I adjust?
「左侧填充 Unicode」的设置:「宽度」默认 8;「填充字符(默认 · 空格)」默认 ;「宽度模型」可选 显示列(中日韩/Emoji=2)、字素(每个=1)(默认 显示列(中日韩/Emoji=2));可勾选:「截断超长行」。每次生成结果都按当前设置处理。Settings in the Left Pad Unicode — "Width" default 8; "Pad char (default · space)" default ; "Width model": Display columns (CJK/emoji = 2), Graphemes (1 each) (default Display columns (CJK/emoji = 2)); tick boxes: "Truncate long lines". The result always uses the current settings.
处理大段文本会卡吗?Can it handle long text?
「左侧填充 Unicode」在浏览器中直接处理,几 MB 以内的文本通常瞬间完成;文本不会离开你的设备。The Left Pad Unicode runs in your browser; text up to a few MB is usually processed instantly and never leaves your device.
「左侧填充 Unicode」免费吗?需要注册吗?Is the Left Pad Unicode free? Do I need an account?
「左侧填充 Unicode」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Left Pad Unicode is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.