From f3bf99da07e8de3389d26025682df4ee143c6775 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Fri, 8 Mar 2024 11:02:56 +0100 Subject: [PATCH] Replace replacement character See https://github.com/confio/cosmjs-types/issues/92 --- CHANGELOG.md | 7 +++++++ packages/encoding/src/utf8.ts | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c85db5e63..eff4050dfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,13 @@ and this project adheres to import { parseCoins } from "@cosmjs/amino"; ``` +### Fixed + +- @cosmjs/encoding: Avoid using replacement character in doc comment to make + external tools happy. ([#1570]) + +[#1570]: https://github.com/cosmos/cosmjs/pull/1570 + ## [0.32.2] - 2023-12-19 ### Fixed diff --git a/packages/encoding/src/utf8.ts b/packages/encoding/src/utf8.ts index bc06300163..9467b70582 100644 --- a/packages/encoding/src/utf8.ts +++ b/packages/encoding/src/utf8.ts @@ -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;