Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2939c209
Unverified
Commit
2939c209
authored
Aug 05, 2020
by
Ian Hickson
Committed by
GitHub
Aug 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update error message for bad UTF-8 decoding (#62888)
parent
6b7634b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
convert.dart
packages/flutter_tools/lib/src/convert.dart
+7
-3
No files found.
packages/flutter_tools/lib/src/convert.dart
View file @
2939c209
...
...
@@ -11,7 +11,10 @@ import 'base/common.dart';
export
'dart:convert'
hide
utf8
,
Utf8Codec
,
Utf8Decoder
;
/// A [Codec] which reports malformed bytes when decoding.
// Created to solve https://github.com/flutter/flutter/issues/15646.
///
/// Occasionally people end up in a situation where we try to decode bytes
/// that aren't UTF-8 and we're not quite sure how this is happening.
/// This tells people to report a bug when they see this.
class
Utf8Codec
extends
Encoding
{
const
Utf8Codec
();
...
...
@@ -40,8 +43,9 @@ class Utf8Decoder extends cnv.Utf8Decoder {
if
(
reportErrors
&&
result
.
contains
(
'
\
u{FFFD}'
))
{
throwToolExit
(
'Bad UTF-8 encoding found while decoding string:
$result
. '
'The Flutter team would greatly appreciate if you could file a bug or leave a '
'comment on the issue https://github.com/flutter/flutter/issues/15646.
\n
'
'The Flutter team would greatly appreciate if you could file a bug explaining '
'exactly what you were doing when this happened:
\n
'
'https://github.com/flutter/flutter/issues/new/choose
\n
'
'The source bytes were:
\n
$codeUnits
\n\n
'
);
}
return
result
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment