Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

quoted_printable_encode does not encode trailing space

未關閉 適合新手
#24,458 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
64/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
c, php
領域
backend

研究方向

首先在 PHP 原始碼樹中找出 quoted_printable_encode 的實作及其現有測試;issue 沒有指定特定檔案。使用結尾帶有空格的範例重現問題,接著檢查編碼後的輸出是否以 =20 結尾,這是所引用的 RFC 2045 規則所要求的。

由索引模型根據 Issue 內容生成。

描述

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

主要語言
C
星號
40.4k
分支
8.2k
平均合併
2 天 22 小時
30 天內合併 PR
166

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

php/php-src 的其他 Issue

查看 php/php-src 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。