Skip to content

Bad UTF-8 encoding (U+FFFD) when decoding Greek text with emojis #171244

@sam-parks-ogk

Description

@sam-parks-ogk

Steps to Reproduce

  1. Attempt to display Greek text with emojis in Flutter
  2. The following string causes the issue:
    stanera σας προσφέρει μια διαμονή ηρεμίας, αποσύνδεσης και χαλάρωσης 🧿💆
    

Expected results

The text should display correctly without any replacement characters.

Actual results

Flutter shows the following error:

flutter: ║                  stanera σας προσφέρει μια διαμονή ηρεμίας, αποσύνδεσης και χαλάρωσης 🧿💆�

With the error message:

Bad UTF-8 encoding (U+FFFD; REPLACEMENT CHARACTER) found while decoding string

Additional Information

The source bytes were:

[102, 108, 117, 116, 116, 101, 114, 58, 32, 226, 149, 145, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 115, 116, 97, 110, 101, 114, 97, 32, 207, 131, 206, 177, 207, 130, 32, 207, 128, 207, 129, 206, 191, 207, 131, 207, 134, 206, 173, 207, 129, 206, 181, 206, 185, 32, 206, 188, 206, 185, 206, 177, 32, 206, 180, 206, 185, 206, 177, 206, 188, 206, 191, 206, 189, 206, 174, 32, 206, 183, 207, 129, 206, 181, 206, 188, 206, 175, 206, 177, 207, 130, 44, 32, 206, 177, 207, 128, 206, 191, 207, 131, 207, 141, 206, 189, 206, 180, 206, 181, 207, 131, 206, 183, 207, 130, 32, 206, 186, 206, 177, 206, 185, 32, 207, 135, 206, 177, 206, 187, 206, 172, 207, 129, 207, 137, 207, 131, 206, 183, 207, 130, 32, 240, 159, 167, 191, 240, 159, 146, 134, 239, 191, 189]

The issue appears at the end where bytes [239, 191, 189] represent the UTF-8 replacement character (U+FFFD), suggesting the original data was corrupted or truncated during encoding/decoding.

Flutter doctor

Please run flutter doctor -v and paste the output here.

Additional context

This appears to be related to handling Greek text combined with emojis, where the string gets truncated or corrupted, resulting in an invalid UTF-8 sequence at the end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions