replace and unicode?

Klaus major-k klaus at major-k.de
Thu Sep 7 12:59:48 CEST 2017


Hi all,

so embarrassing, there was no SPACE after the mm2, but a TAB! :-/
So I got it working, thank you for your help.

> Am 07.09.2017 um 12:55 schrieb Klaus major-k via use-livecode <use-livecode at lists.runrev.com>:
> ...
>>> My effort so far:
>>> ...
>>> ## Read TXT file and make it LC compatible, this is doing fine:
>>> put url ("binfile:" & tFile) into tData
>>> put textdecode(tData,"UTF-8") into tDataComplete
>>> replace CRLF with CR in tDataComplete
>>> ## Superscript 2 in Unicode
>>> put numToCodepoint(0x00B2) into tSup
>>> ## But this line does nothing actually?
>>> replace "mm2 " with ("mm" & tSup & " ") in tDataComplete
>> 
>> I tried:
>> 
>> put "mm2 foo Танюша mm2 bar" into tText
>> put numToCodepoint(0x00B2) into tSup
>> replace "mm2 " with ("mm" & tSup & " ") in tText
>> put tText
>> 
>> Here in a variety of versions and it seems to work...
>> What is the contents of tDataComplete in the case you can't get to work?
> 
> The line in question before "replace":
> 40mm2 100mm2 200mm2
> The line in question after "replace":
> 40mm2 100mm2 200mm2
> ???
> 
> Even this in a field with that line does not work?
> ...
> put numToCodepoint(0x00B2) into tSup
> replace "mm2 " with ("mm" & tSup & " ") in fld 1
> ...

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major-k.de




More information about the use-livecode mailing list