Add UTF-8 encoding for reading bulk updates #34

Merged
marko merged 1 commits from dev into main 2025-10-15 04:51:41 +00:00
Owner

This commit introduces the use of the Encode module to ensure that
values being processed in the WriteReadings subroutine are correctly
encoded in UTF-8. The previous implementation did not account for
potential non-UTF-8 encoded data which could lead to issues when
updating readings.

The change specifically checks if the value ($v) is marked as UTF-8
using Encode::is_utf8(). If it is, the value is re-encoded to UTF-8
before being passed to ::readingsBulkUpdate(). This adjustment
ensures that all data written to readings maintains proper character
encoding, improving compatibility and preventing potential data
corruption.

No breaking changes are introduced, but it is important for users
to validate that their readings correctly display any special
characters post-update.

This commit introduces the use of the `Encode` module to ensure that values being processed in the `WriteReadings` subroutine are correctly encoded in UTF-8. The previous implementation did not account for potential non-UTF-8 encoded data which could lead to issues when updating readings. The change specifically checks if the value (`$v`) is marked as UTF-8 using `Encode::is_utf8()`. If it is, the value is re-encoded to UTF-8 before being passed to `::readingsBulkUpdate()`. This adjustment ensures that all data written to readings maintains proper character encoding, improving compatibility and preventing potential data corruption. No breaking changes are introduced, but it is important for users to validate that their readings correctly display any special characters post-update.
marko added 1 commit 2025-10-15 04:51:38 +00:00
This commit introduces the use of the `Encode` module to ensure that
values being processed in the `WriteReadings` subroutine are correctly
encoded in UTF-8. The previous implementation did not account for
potential non-UTF-8 encoded data which could lead to issues when
updating readings.

The change specifically checks if the value (`$v`) is marked as UTF-8
using `Encode::is_utf8()`. If it is, the value is re-encoded to UTF-8
before being passed to `::readingsBulkUpdate()`. This adjustment
ensures that all data written to readings maintains proper character
encoding, improving compatibility and preventing potential data
corruption.

No breaking changes are introduced, but it is important for users
to validate that their readings correctly display any special
characters post-update.
marko merged commit 8524d188d7 into main 2025-10-15 04:51:41 +00:00
Sign in to join this conversation.
No description provided.