Skip to content

Commit

Permalink
Replace replacement character
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Mar 8, 2024
1 parent 11ce122 commit 78f6635
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/encoding/src/utf8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export function toUtf8(str: string): Uint8Array {
/**
* Takes UTF-8 data and decodes it to a string.
*
* In lossy mode, the replacement character � is used to substitude invalid
* encodings. By default lossy mode is off and invalid data will lead to exceptions.
* In lossy mode, the [REPLACEMENT CHARACTER](https://en.wikipedia.org/wiki/Specials_(Unicode_block))
* is used to substitude invalid encodings.
* By default lossy mode is off and invalid data will lead to exceptions.
*/
export function fromUtf8(data: Uint8Array, lossy = false): string {
const fatal = !lossy;
Expand Down

0 comments on commit 78f6635

Please sign in to comment.