Skip to content

Use allowMalformed: true with utf8.decode when checking for hasDocumentation #1889

@isoos

Description

@isoos

Otherwise with a few bad UTF-8 characters it will throw:

FileSystemException: Failed to decode data using encoding 'utf-8', path = '/tmp/pub-dartlang-dartdocNPAPOD/pkg/README.md'
#0      _File._tryDecode (dart:io/file_impl.dart:576:7)
#1      _File.readAsStringSync (dart:io/file_impl.dart:596:7)
#2      FileContents.contents (package:dartdoc/src/package_meta.dart:215:31)
#3      Package.hasDocumentation (package:dartdoc/src/model.dart:5990:54)
#4      _LocalInstanceMirror._invokeGetter (dart:mirrors/runtime/libmirrors_impl.dart:329:76)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failurestype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions