How do I convert a string of bytes into characters?

Get help using Construct 2

Post » Tue May 26, 2015 8:10 pm

Hi all,

I have a string in C2 of bytes (of a URL) that I need to convert into text for use in C2

EG:

"1,103,111,111,103,108,101,46,99,111,109" (comma separated bytes in a string)

that I need to convert to:

"google.com"

What is the simplest way to do this in C2?

OR, if there is a quick and easy way to use the Browser.Javascript feature to achieve this result -- I'd accept that too... Haven't had much exposure to that feature in C2 though, or how you reference/store results into a C2 string datatype...

Any help would be appreciated :)
Cheers,

-Remy
B
71
S
14
G
1
Posts: 151
Reputation: 4,974

Post » Tue May 26, 2015 8:13 pm

https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Tue May 26, 2015 8:18 pm

Yes @gumshoe2029 , but, I don't really know how I could implement that through the C2 IDE, do you? :)
B
71
S
14
G
1
Posts: 151
Reputation: 4,974

Post » Tue May 26, 2015 8:20 pm

I could, but it would be a lot of work. I haven't become really competent with the IDE myself. I mostly work on the server side in Java.

How did you come about receiving a byte array to begin with?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Tue May 26, 2015 8:22 pm

Reading bytes from an NFC tag via a C2 Plugin :)
B
71
S
14
G
1
Posts: 151
Reputation: 4,974

Post » Tue May 26, 2015 8:25 pm

And it doesn't have a byte parser built in? Perhaps you could modify that plugin and add that functionality to it.

I have modified a few of Rex's plugins. It is FAR easier to modify plugins than to write new ones.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Tue May 26, 2015 8:31 pm

Maybe the easiest way would be to use the dictionary object to store the symbols

http://ascii.cl/

and use TokenAt to get the corresponding symbol to your ascii code..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed May 27, 2015 12:17 pm

You can use this online tool to convert ascii to text:
convert.town/ascii-to-text
B
2
Posts: 2
Reputation: 154


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, mrkaio, muquia, tarek2 and 2 guests