Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Yaml with emoji cause error "the stream contains non-printable characters" #37

Open
JPinkney opened this issue Mar 7, 2019 · 1 comment

Comments

@JPinkney
Copy link

JPinkney commented Mar 7, 2019

While using vscode + YAML Language support extensions (version 0.3.0), I found that using emojis cause errors :

  • VSCode Version:
code --version 
1.31.1
1b8e8302e405050205e69b59abb3559592bb9e60
x64
  • OS Version:
cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
...
UBUNTU_CODENAME=bionic

Steps to Reproduce:

  1. Create a test.yml file with this content as this there is no parsing error (extract from a gitlab-ci.yml file) :
stages:
  - build

build:
  stage: build
  before_script:
    - echo "hi"
  script:
    - echo "hi"
  1. Create a test.yml with the same content but using also some emojis :
stages:
  - build

build:
  stage: build
  before_script:
    - echo "📢 - hi - 👷"
  script:
    - echo "📢 - hi - 👷"

This leads to the following errors :

{
	"resource": "/test.yml",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "the stream contains non-printable characters",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 1
}
{
	"resource": "/test.yml",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "incomplete explicit mapping pair; a key node is missed",
	"startLineNumber": 1,
	"startColumn": 7,
	"endLineNumber": 2,
	"endColumn": 5
}
{
	"resource": "/test.yml",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "end of the stream or a document separator is expected",
	"startLineNumber": 2,
	"startColumn": 3,
	"endLineNumber": 4,
	"endColumn": 2
}
{
	"resource": "/test.yml",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "end of the stream or a document separator is expected",
	"startLineNumber": 4,
	"startColumn": 6,
	"endLineNumber": 5,
	"endColumn": 4
}

copied from redhat-developer/yaml-language-server#128

@ssbarnea
Copy link

ssbarnea commented Jun 2, 2020

AFAIK, Unicode use is accepted by YAML specification and emoji are clearly not non-printable characters. Unicode is very clear about what is non-printable character.

Any chance to fix this? I see the bug was opened a very long time without any updates and clearly impacts YAML vscode extension.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants