Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ext-mbstring should be required

Open
#203 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
web-dev

Research direction

Start by reviewing Masterminds\HTML5\Parser\CharacterReference::lookupDecimal() and Masterminds\HTML5\Parser\UTF8Utils::convertToUTF8(), focusing on their unconditional mbstring use and iconv/utf8_decode fallbacks. Done means mbstring is required, iconv and utf8_decode fallback code are removed, and the parser continues to handle non-auto input encodings correctly.

Written by the indexing model from the issue text.

Description

Here's why:

  1. Masterminds\HTML5\Parser\CharacterReference::lookupDecimal() uses mb_decode_numericentity() unconditionally.
  2. Looking at Masterminds\HTML5\Parser\UTF8Utils::convertToUTF8() either iconv or mbstring must be available (if the input encoding is not 'auto').

This would allow to:

  1. Get rid of iconv() use. In my experience mbstring is really a better solution.
  2. Remove use of utf8_decode() which is not really valid and not needed when mbstring is available.
  3. Get rid of the fallback code.
Dominant language
HTML
Stars
1.8k
Forks
123
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Masterminds/html5-php

All issues in Masterminds/html5-php

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.