code: def test_pl_app_encode_icon(monkeypatch):
      stdout_mock = Mock(wraps=sys.stdout)
      monkeypatch.setattr(sys, "stdout", stdout_mock)
  
      stdout_mock.encoding = "utf-8"
      assert _can_encode_icon("📂")
      assert _can_encode_icon("📄")
  
      stdout_mock.encoding = "ascii"
      assert not _can_encode_icon("📂")
      assert not _can_encode_icon("📄")
  
file_path: pytorch-lightning/tests/tests_app/cli/test_cmd_pl_init.py
imports: import os
  import sys
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  from click.testing import CliRunner
  from lightning.app.cli import lightning_cli
  from lightning.app.cli.cmd_pl_init import _can_encode_icon, download_frontend, pl_app
label_desc: Use image node_id 6 for calling a global function with example usage: test_pl_app_encode_icon(monkeypatch) without return types