fix: json-utf8-sanitize#10
Conversation
Log: scripts: default-nodes: sanitize UTF-8 before JSON serialization Some hardware reports ALSA card long names with invalid UTF-8 byte sequences (e.g. GBK/GB2312 encoded Chinese characters). This causes Json.Object() serialization to fail, which drops the affected node from the available-nodes list in the select-default-node event. As a result, users cannot switch to HDMI sinks even though the device appears in `wpctl status`. Add sanitize_utf8() to replace invalid UTF-8 sequences with the Unicode replacement character (U+FFFD) before passing properties to Json.Object(). This ensures JSON serialization succeeds and the HDMI node remains in the candidate list. Signed-off-by: liujiahe <liujiahe@uniontech.com>
|
TAG Bot TAG: 0.5.14-1deepin4 |
|
Hi @pluuc. Thanks for your PR. 😃 |
|
Hi @pluuc. Thanks for your PR. I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qaqland The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold |
|
/integrate |
|
AutoIntegrationPr Bot |
Log:
scripts: default-nodes: sanitize UTF-8 before JSON serialization
Some hardware reports ALSA card long names with invalid UTF-8 byte sequences (e.g. GBK/GB2312 encoded Chinese characters). This causes Json.Object() serialization to fail, which drops the affected node from the available-nodes list in the select-default-node event.
As a result, users cannot switch to HDMI sinks even though the device appears in
wpctl status.Add sanitize_utf8() to replace invalid UTF-8 sequences with the Unicode replacement character (U+FFFD) before passing properties to Json.Object(). This ensures JSON serialization succeeds and the HDMI node remains in the candidate list.