Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

quoted_printable_encode does not encode trailing space

Đang mở Phù hợp với người mới
#24,458 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
64/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, php
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu bằng cách tìm phần triển khai của quoted_printable_encode và các bài kiểm thử hiện có trong cây mã nguồn PHP; issue không nêu tên tệp cụ thể. Tái hiện ví dụ có dấu cách ở cuối, rồi kiểm tra xem đầu ra đã mã hóa có kết thúc bằng =20 như quy tắc RFC 2045 được trích dẫn yêu cầu hay không.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug Status: Needs Triage
Description

The following code:

<?php
var_dump(quoted_printable_encode('hello '));

Resulted in this output:

string(6) "hello "

But I expected this output instead:

string(9) "hello=20"

RFC 2045 says:

(3)   (White Space) Octets with values of 9 and 32 MAY be
      represented as US-ASCII TAB (HT) and SPACE characters,
      respectively, but MUST NOT be so represented at the end
      of an encoded line.  Any TAB (HT) or SPACE characters
      on an encoded line MUST thus be followed on that line
      by a printable character.  In particular, an "=" at the
      end of an encoded line, indicating a soft line break
      (see rule #5) may follow one or more TAB (HT) or SPACE
      characters.  It follows that an octet with decimal
      value 9 or 32 appearing at the end of an encoded line
      must be represented according to Rule #1.  This rule is
      necessary because some MTAs (Message Transport Agents,
      programs which transport messages from one user to
      another, or perform a portion of such transfers) are
      known to pad lines of text with SPACEs, and others are
      known to remove "white space" characters from the end
      of a line.  Therefore, when decoding a Quoted-Printable
      body, any trailing white space on a line must be
      deleted, as it will necessarily have been added by
      intermediate transport agents.
PHP Version
PHP 8.7.0-dev (cli) (built: Oct 18 2026 16:29:33) (NTS DEBUG)
Copyright © The PHP Group and Contributors
Zend Engine v4.7.0-dev, Copyright © Zend by Perforce
    with Zend OPcache v8.7.0-dev, Copyright ©, by Zend by Perforce
Operating System

No response

Ngôn ngữ chính
C
Star
40.4k
Fork
8.2k
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
166

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của php/php-src

Tất cả issue của php/php-src

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.