Re: Help converting Hex UTF-8 bytes to character

2018-06-01 Thread Trevor DeVore via use-livecode
On Fri, Jun 1, 2018 at 2:06 AM, Mark Waddingham via use-livecode < use-livecode@lists.runrev.com> wrote: > On 2018-06-01 06:21, Monte Goulding via use-livecode wrote: > >> On 1 Jun 2018, at 2:18 pm, Trevor DeVore via use-livecode < >>> use-livecode@lists.runrev.com> wrote: >>> >>> Yes it does! `fo

Re: Help converting Hex UTF-8 bytes to character

2018-06-01 Thread Mark Waddingham via use-livecode
On 2018-06-01 06:21, Monte Goulding via use-livecode wrote: On 1 Jun 2018, at 2:18 pm, Trevor DeVore via use-livecode wrote: Yes it does! `format` is my new best friend. Hmm… why not just throw the whole thing at format? If it has one escape sequence it might have others and you can’t put on

Re: Help converting Hex UTF-8 bytes to character

2018-05-31 Thread Monte Goulding via use-livecode
> On 1 Jun 2018, at 2:18 pm, Trevor DeVore via use-livecode > wrote: > > Yes it does! `format` is my new best friend. Hmm… why not just throw the whole thing at format? If it has one escape sequence it might have others and you can’t put one in there and expect a single `\` to be literal.

Re: Help converting Hex UTF-8 bytes to character

2018-05-31 Thread Trevor DeVore via use-livecode
On Thu, May 31, 2018 at 5:20 PM, Monte Goulding via use-livecode < use-livecode@lists.runrev.com> wrote: > > I’m pretty sure that the following will do what you want here: > > textDecode(format(),”utf-8”) > Yes it does! `format` is my new best friend. Thanks for everyone’s tips. Here is what I c

Re: Help converting Hex UTF-8 bytes to character

2018-05-31 Thread Monte Goulding via use-livecode
Hi Trevor I’m pretty sure that the following will do what you want here: textDecode(format(),”utf-8”) Cheers Monte > On 1 Jun 2018, at 6:13 am, Trevor DeVore via use-livecode > wrote: > > Hi, > > I have a text file that contains Hex UTF-8 bytes encode in the following > manner: > > ``` >

Re: Help converting Hex UTF-8 bytes to character

2018-05-31 Thread Paul Dupuis via use-livecode
Actually, I think I meant tOS+2 to tOS+3, if the find starts on \x##, the the \ is tOS and tOS+1 is the x That's way I get for rushing a reply. On 5/31/2018 4:47 PM, Bob Sneidar via use-livecode wrote: > You meant tOS+1 to tOS+2? > >> On May 31, 2018, at 13:39 , Paul Dupuis via use-livecode >>

Re: Help converting Hex UTF-8 bytes to character

2018-05-31 Thread Bob Sneidar via use-livecode
You meant tOS+1 to tOS+2? > On May 31, 2018, at 13:39 , Paul Dupuis via use-livecode > wrote: > > tOS+2 to tOS+2 into tByte1 and char tOS+6 to tOS+7 into byte2 to get the ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this

Re: Help converting Hex UTF-8 bytes to character

2018-05-31 Thread Paul Dupuis via use-livecode
As a general approach: 1) use offset() looking for "\x" (or you could use regex) to find the start 2) if the value returned by offset is not zero (call it tOS) put char tOS+2 to tOS+2 into tByte1 and char tOS+6 to tOS+7 into byte2 to get the 2 hex values 3) use the formula put baseConvert(byte1,16

Help converting Hex UTF-8 bytes to character

2018-05-31 Thread Trevor DeVore via use-livecode
Hi, I have a text file that contains Hex UTF-8 bytes encode in the following manner: ``` \xC3\xB3 ``` This particular sequence represents the following character: ``` ó ``` I need to read this file in, converting these hex bytes to the proper character. For example, the following string: ```