# [RFC] [Discussion] Add multibyte trim function (mb_trim, mb_ltrim and mb_rtrim)

- Thread: https://externals.io/message/121431
- Original archive: https://news-web.php.net/php.internals/121431
- Started by youkidearitai on 2023-10-19T11:57:22+00:00
- Messages: 3
- RFC: Multibyte for trim function mb_trim, mb_ltrim and mb_rtrim (Implemented (PHP 8.4)) — https://externals.io/rfc/mb_trim.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #121431 — youkidearitai — 2023-10-19T11:57:22+00:00

URL: https://externals.io/message/121431#121431

Hi, internals.

8ctopus san can't send email, so I'm writing new RFC for multibyte
trim function.
https://wiki.php.net/rfc/mb_trim
https://github.com/php/php-src/pull/12459

I would like to under discussion.

Regards.
Yuya

-- 
---------------------------
Yuya Hamada (tekimen)
- https://tekitoh-memdhoi.info
- https://github.com/youkidearitai

---

## #121432 — Niels Dossche — 2023-10-19T13:33:26+00:00

URL: https://externals.io/message/121431#121432 · In reply to: #121431

Hi Yuya


> Hi, internals.
> 
> 8ctopus san can't send email, so I'm writing new RFC for multibyte
> trim function.
> https://wiki.php.net/rfc/mb_trim
> https://github.com/php/php-src/pull/12459
> 
> I would like to under discussion.

Thanks for this.

I have a question about the .. support:
You state "Mapping with other character codes may be incompatible", for one of the reasons not to support this.
Can you please explain this a bit more?

Also, I notice at the top of your RFC it still says: "Status: Draft", I think you forgot to change this.
Similarly, the RFC is not listed under discussion on https://wiki.php.net/rfc.

> 
> Regards.
> Yuya
> 

Kind regards
Niels

---

## #121433 — youkidearitai — 2023-10-19T14:35:34+00:00

URL: https://externals.io/message/121431#121433 · In reply to: #121432

2023年10月19日(木) 22:33 Niels Dossche <dossche.niels@gmail.com>:
>
> Hi Yuya
>
> 
> > […]
>
> Thanks for this.
>
> I have a question about the .. support:
> You state "Mapping with other character codes may be incompatible", for one of the reasons not to support this.
> Can you please explain this a bit more?
>
> Also, I notice at the top of your RFC it still says: "Status: Draft", I think you forgot to change this.
> Similarly, the RFC is not listed under discussion on https://wiki.php.net/rfc.
>
> > […]
>
> Kind regards
> Niels
>
> --
> 
> To unsubscribe, visit: https://www.php.net/unsub.php
>

Hi, Niels.
Thank you for your question and Wiki status is changed.

> You state "Mapping with other character codes may be incompatible", for one of the reasons not to support this.
> Can you please explain this a bit more?

Sure.
For example, Japanese character code, If try to match hiragana for
each character code,
it will end up with different bytes.

Hiragana letter matches in UTF-8.
[ぁ-ゞ]

But other character code is sometimes different.
example: EUC-JP
[ぁ-ん゛ゝゞ]

Sometimes the order is different why I say "Mapping with other
character codes may be incompatible".
Therefore, I thought it was impossible to express the ".." notation.

Regards
Yuya

-- 
---------------------------
Yuya Hamada (tekimen)
- https://tekitoh-memdhoi.info
- https://github.com/youkidearitai
