this would not be correct. Because Unicode is not just utf-8. utf-32 for example is also Unicode. But I could write: Converts a byte array which contains utf8 (Unicode) characters into an utf8 (Unicode) string (QString).
What do you think?
And thx for your thoughts/ your comment. I'm always trying to improve the documentation.
Regards
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-10-29
Yes you are right, sorry.
I think the function is return utf-16 format.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm calling QString::fromUtf8 internally. In other words byteArrayToUtf8String retruns a QString. The name of this function should better be utf8ByteArrayToString. Maybe I rename this function in a future release (but keep it internally for compabillity with older scripts).
I had a look in the Qt documentation. QString stores strings in utf-16 format internally. All script strings in ScriptCommunicator are stored as QString strings.
Last edit: Stefan Zieker 2018-10-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-10-29
thank you for the explanation. would it be possible to create a new function (StringToUtf8byteArray?) which would create utf-8 from Qstring (utf-16 internally)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi,
in the manual is a description of the function
Converts a byte array which contains utf8 characters into an utf8 string (QString).
it would be better to write:
Converts a byte array which contains utf8 characters into an Unicode string (QString).
i'm not a programmer and I was surprised why it's not utf-8.
Hi,
this would not be correct. Because Unicode is not just utf-8. utf-32 for example is also Unicode. But I could write: Converts a byte array which contains utf8 (Unicode) characters into an utf8 (Unicode) string (QString).
What do you think?
And thx for your thoughts/ your comment. I'm always trying to improve the documentation.
Regards
Stefan
Yes you are right, sorry.
I think the function is return utf-16 format.
Hi,
I'm calling QString::fromUtf8 internally. In other words byteArrayToUtf8String retruns a QString. The name of this function should better be utf8ByteArrayToString. Maybe I rename this function in a future release (but keep it internally for compabillity with older scripts).
I had a look in the Qt documentation. QString stores strings in utf-16 format internally. All script strings in ScriptCommunicator are stored as QString strings.
Last edit: Stefan Zieker 2018-10-29
thank you for the explanation. would it be possible to create a new function (StringToUtf8byteArray?) which would create utf-8 from Qstring (utf-16 internally)?
This would be no problem. I could create a prerelease. Which plattform do you use (Windows ...)?
yes, the 'awesome' windows platform. Thank you.
I have uploaded a prerelease under Files/Test.
The new function is called conv.stringToUtf8Array.
Regards,
Stefan
Last edit: Stefan Zieker 2018-10-29
function works perfectly. test Pangram sentences in my language have passed correctly. curl, servers and me are happy.
thank you once again
my pleasure
Hi,
I have released a new version of ScriptCommunicator (5.10) which includes this new feature.