Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter: Response string encoding #12

Closed
vinidiktov opened this issue Aug 4, 2020 · 3 comments
Closed

Flutter: Response string encoding #12

vinidiktov opened this issue Aug 4, 2020 · 3 comments

Comments

@vinidiktov
Copy link

vinidiktov commented Aug 4, 2020

Hello,

I'm having trouble getting correctly encoded response strings.

Tried both Flutter for Web and for macOS.

I'm on Flutter 1.21.0-1.0.pre • channel dev.

final url2 = 'https://app.vocabilis.com/test/public_call/xmlrpc';
final result = await xml_rpc.call(url2, 'foo', ['мир']);
print(result);

The result I'm getting is "ми� baz".
The correct result should be "мир baz".

What am I missing?

@a14n
Copy link
Owner

a14n commented Aug 4, 2020

By default utf8 encoding is used but you can provided something else with the encoding named parameter

@vinidiktov
Copy link
Author

The server seems to be sending the result in utf8.

I assumed that the string "ми� baz" was encoded as utf8 by the server but not decoded properly by the client.

You can load the pure xml (non rpc) version here:
https://app.vocabilis.com/test/public_call/xml/foo?bar=привет

@a14n
Copy link
Owner

a14n commented Aug 4, 2020

When you exchange xml_rpc datas both client and server have to use the same encoding. IIRC the spec does not specify an encoding.

@a14n a14n closed this as completed Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants