I am facing a problem with unicode - unidecode etc, I know it has been a classic problem but still it gives me a hard time. So as you can understand from the uploaded file in the end of this post, I load a csv with unicode(utf-8) greek characters, in fld"1" , at first I couldn't even read the characters correct,then I found the following code, so the greek characters were properly presented in my fld.
Code: Select all
answer file "Select a file"
put it into tFile
put url ("file:" & tFile) into tUnicodeText
set the unicodeText of field 1 to uniEncode(tUnicodeText,"UTF8")
put url("file:" & tFile) into fld 1
Then I had to split those data into fields so i can send them to a socket, I managed to do that, and managed to send them in greek with the following code
Code: Select all
repeat with x=1 to the number of lines of field "1"
add 1 to counter
end repeat
repeat with x=1 to the number of flds of group "pl"
add 1 to counter
put textencode(item 2 of line x of fld 1,"UTF-8") into fld x of grp "pl"
end repeat
The problem is that the data in the fields are again presented """chinese""" with all the respect to Chinese characters. I tried again to add the first code, and the "chinese" turned to greek, but only "question marks" come to the socket.
Any suggestions
Thanks in advance
Ioannis
https://ufile.io/spmql <---- Project
https://uploadfiles.io/kac60 <---- Csv FIle