
Well, I am no socket expert, but it sound like they only like ASCII somehow.
As proposed earlier in this thread, you could base64encode your UTF8 string
so it gets "converted" to ASCII.
No idea this will work, but at least worth a try

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
on mouseUp
set the unicodeText of field "testfield2" to the unicodeText of field "testfield"
put the unicodetext of fld "testfield2" into tData
put uniDecode(tData,"utf16") into field "testfield3"
end mouseUp
Code: Select all
on mouseup
## Some chinese text in fld 1, works, same strange characters in fld 2 :-D
set the unicodetext of fld 2 to the unicodetext of fld 1
## put unicodetext into variable
put the unicodetext of fld 2 into tt
## as mentioned earlier, "turn" binary(sic!) unicodetext to ASCII
put base64encode(tt) into tt2
## Test: Yes, really two lines of pure ASCII :-)
put tt2
## When "converted" back to unicode, this line works as exspected:
set the unicodetext of fld 3 to base64decode(tt2)
end mouseup
completely not the problem, please read threads more carefullyFourthWorld wrote:People sometimes say it's overkill, but I've found time and again that when I have transport issues with binary data like Unicode, converting it to base64 seems to take care of it.
There may be ways to adjust the header to address that without converting to base64, but base64 is so convenient in LC that it's often a pretty good way to resolve such issues.
My apologies. With so many posts and my volunteer admin tasks here, I rarely have the time to completely re-read every thread here before replying, and admittedly this may sometimes mean a post from me that doesn't account for errors in other posts.BvG wrote:completely not the problem, please read threads more carefully
that too of course, but actually the problems Aircooled has are more in the direction of basic programming, like how to use functions and repeat loops. The somewhat weird way how LC does Unicode doesn't help either (Great job Klaus, in trying to continuingly offering help btw).FourthWorld wrote:So if I understand you correctly, the base64Encode included in so many prior posts is completely unnecessary?
Code: Select all
write "CG 1-" & field "coach3rdvl" of card settings && "add" && field coach3rdfl of card settings &"e& field coach3rd of the card settings &"_home" "e&" 1 ""e&"<templateData><componentData id=\""e&"_name\""e&">" & cr & \
"<data id=\""e&"text\""e&" value=\" "e& uniDecode (the unicodetext of field T1Coach,"UTF8") & "\""e&">" & cr & \
"</data> </componentData><componentData id=\""e&"_club\""e&">" & cr & \
"<data id=\""e&"text\""e&" value=\" "e& field t1fullname of card Controller & "\""e&">" & cr & \
"</data></componentData></templateData>""e&"" & format("\r\n") to socket field IP of card settings
Code: Select all
uniDecode (the unicodetext of field T1Coach,"UTF16")
Code: Select all
Use the base64Encode function to encode binary data for transmission over communication channels that don't accept raw binary data.
Code: Select all
uniDecode (the unicodetext of field T1Coach,"UTF8")
Code: Select all
CG 1-2 add 4 "coach_home" 1 "<templateData><componentData id=\"_name\">
<data id=\"text\" value=\" š�ćđž ČĆŽŠ�\">
</data> </componentData><componentData id=\"_club\">
<data id=\"text\" value=\"HOME TEAM NAME\">
</data></componentData></templateData>"
Code: Select all
uniDecode (the unicodetext of field T1Coach,"UTF16")
Code: Select all
CG 1-2 add 4 "coach_home" 1 "<templateData><componentData id=\"_name\">
<data id=\"text\" value=\" šccdž CCŽŠÐ\">
</data> </componentData><componentData id=\"_club\">
<data id=\"text\" value=\"HOME TEAM NAME\">
</data></componentData></templateData>"
Code: Select all
on mouseUp
ask file "Select a location to save to"
if the result is not "cancel" then
put "CG 1-" & field "coach3rdvl" of card settings && "add" && field coach3rdfl of card settings &"e& field coach3rd of the card settings &"_home" "e&" 1 ""e&"<templateData><componentData id=\""e&"_name\""e&">" & cr & \
"<data id=\""e&"text\""e&" value=\" "e& uniDecode (the unicodetext of field T1Coach,"UTF8") & "\""e&">" & cr & \
"</data> </componentData><componentData id=\""e&"_club\""e&">" & cr & \
"<data id=\""e&"text\""e&" value=\" "e& field t1fullname of card Controller & "\""e&">" & cr & \
"</data></componentData></templateData>""e&"" & format("\r\n") into url ("file:" & it)
end if
end mouseUp
Code: Select all
CG 1-2 add 4 "coach_home" 1 "<templateData><componentData id=\"_name\">
<data id=\"text\" value=\" ščćđž ČĆŽŠĐ\">
</data> </componentData><componentData id=\"_club\">
<data id=\"text\" value=\"HOME TEAM NAME\">
</data></componentData></templateData>"