Skip to content

Commit 3928963

Browse files
committed
decoder: Tests for charset transformation
1 parent e37c951 commit 3928963

File tree

6 files changed

+541
-0
lines changed

6 files changed

+541
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ Response is decoded following similar rules to argument encoding.
7878
* Structs may contain pointers - they will be initialized if required.
7979
* Structs may be parsed as `map[string]any`, in case struct member names are not known at compile time. Map keys are enforced to `string` type.
8080

81+
#### Character Encoding Support
82+
83+
The library automatically detects and handles character encodings in XML-RPC responses beyond UTF-8, including ISO-8859-1, Windows-1252, and other charsets commonly found in legacy XML-RPC services.
84+
85+
Character encoding is automatically detected from the XML declaration (e.g., `<?xml version="1.0" encoding="ISO-8859-1"?>`), and the response is transparently converted to UTF-8 for Go string handling. This enables seamless interoperability with XML-RPC servers that don't use UTF-8 encoding.
86+
87+
**Note:** This feature relies on the `golang.org/x/net/html/charset` package.
88+
8189
#### Handling of Empty Values
8290

8391
If XML-RPC response contains no value for well-known data-types, it will be decoded into the default "empty" values as per table below:

0 commit comments

Comments
 (0)