Closed crazywhalecc closed 1 year ago
Hey @crazywhalecc,
TIL about mb_strwidth
! Thank you! I've been using mb_strlen
, which works fine for single-width multibyte characters like accents, but not emojis, etc.
I'll have a play around and hopefully get something together very soon.
Came across this using Japanese with Prompt 0.1.3
on WSL.
Continuing the discussion over at #33
Laravel Prompts Version
v0.1.1 (I also tested dev-main)
Laravel Version
Independent installation of prompts
PHP Version
8.2.8
Operating System & Version
macOS 13.0
Terminal Application
Terminal
Description
When I input multi-byte characters (such as Chinese, Japanese, Emoji, etc.), the width of the border at the end changes. These multibyte characters occupy 2 spaces, but the calculation boundary may use its actual length (3 spaces).
Maybe using
mb_strwidth
to solve this?Steps To Reproduce