Skip to content

Incorrect utf-8 handling on require('file.yaml') #54

@maxp

Description

@maxp

When js-yaml loads long files with multibyte utf-8 symbols sometimes it brokes characters (replaces valid unicode char by two error marks)

yaml = require('js-yaml')
data_broken = require('mydata.yaml')
data_correct = yaml.load( fs.readFileSync('mydata.yaml') )

Probably it happens when utf-8 symbol lays exactly on read buffer boundary and byte reader splits it on two incorrect parts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions