unicode & umlauts

Niggemann, Bernd Bernd.Niggemann at uni-wh.de
Fri Jun 22 04:49:13 EDT 2018

Hi Eric, 

I retested Scott's solution and it works like a charm. I must have made a mistake when copying the code initially.

It is a lot easier and more sensible than my solution.

this is Scott's script that works for me

on mouseup
   local theText, tResult, targetText
   repeat with i = 1 to the number of lines in card field "source"
      put URLEncode(textencode(line i of cd fld "source","utf-8")) into theText
      put  \
            "https://translate.yandex.net/api/v1.5/tr.json/translate?key=trnsl.1.1.20180527T091305Z.7f33f9fb3f66f0bb.d573f1d9a6336a981504916600c45f49255938b3&text="&theText&"&lang=de-en&format=html" \
            into tResult
      put URL tResult into tResult
      set the itemdelimiter to "["
      put the last item of tResult into targetText
      put textDecode(targetText,"UTF8") & return after cd fld "target"
   end repeat
end mouseup

Kind regards

More information about the Use-livecode mailing list