Skip to content

Problem when ISO-2022-JP-MS is specified in mb_encode_mimeheader #9683

Closed

Description

@nanasess

Description

PHP8.0.x or earlier will decode correctly, but PHP8.1.x will output undecoded strings.

The following code:

<?php

echo mb_decode_mimeheader(mb_encode_mimeheader('1234567890123456789012', 'ISO-2022-JP-MS', 'B'));

Resulted in this output:

123456789012345678#9#0#1#2

But I expected this output instead:

1234567890123456789012

PHP Version

PHP 8.1.6

Operating System

Ubuntu 20.04

Activity

  1. cmb69 commented on Oct 7, 2022

    @cmb69
    Member

    Indeed, there is something wrong in PHP 8.1: https://3v4l.org/ucPUC

  2. alexdowad commented on Oct 10, 2022

    @alexdowad
    Contributor

    @nanasess, thank you for reporting this problem! And as always, many thanks for @cmb69 and @Girgias for handling triage of incoming bug reports.

    Interestingly, I have already fixed this problem in PHP-8.2+, in f3c8efd. However, the bug fix needs to be backported to PHP-8.1.

    Let me work on that.

  3. alexdowad commented on Oct 10, 2022

    @alexdowad
    Contributor

    I am also adding a regression test for this.

  4. added 3 commits that reference this issue on Oct 10, 2022
    5812b4f
    faa5425
    a116aae
  5. added a commit that references this issue on Oct 10, 2022
  6. alexdowad commented on Oct 10, 2022

    @alexdowad
    Contributor

    Thanks again!

    This fix will be included in the next release of PHP 8.1.

  7. changed the title [-]Problem when ISO-2022-JP-MS is specified in mb_ encode_mimeheader[/-] [+]Problem when ISO-2022-JP-MS is specified in mb_encode_mimeheader[/+] on Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions