Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EightBitContentEncoder.php 861B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Mime\Encoder;
  11. /**
  12. * @author Fabien Potencier <fabien@symfony.com>
  13. *
  14. * @experimental in 4.3
  15. */
  16. final class EightBitContentEncoder implements ContentEncoderInterface
  17. {
  18. public function encodeByteStream($stream, int $maxLineLength = 0): iterable
  19. {
  20. while (!feof($stream)) {
  21. yield fread($stream, 16372);
  22. }
  23. }
  24. public function getName(): string
  25. {
  26. return '8bit';
  27. }
  28. public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string
  29. {
  30. return $string;
  31. }
  32. }