Hi Guys! can someone help me to create a blueprint to convert Hex to string?
I have already started some stuff, but without success
I don’t understand your initial setup here. What do you have and what string should you produce?
The Hex… What variable type are you holding it in? Do you actually want a conversion from int to hex string?
Can you give a simple example?
Hi there! No I’m trying to convert file coming from an API, those files are calling Dump Binary files for instance (00000000: 7B 22 4D 65 73 73 61 67 65 22 3A 7B 22 50 6F 73 {“Message”:{“Pos
00000010: 69 74 69 6F 6E 52 65 70 6F 72 74 22 3A 7B 22 43 itionReport”:{“C
00000020: 6F 67 22 3A 33 30 35 2E 33 2C 22 43 6F 6D 6D 75 og”:305.3,“Commu
00000030: 6E 69 63 61 74 69 6F 6E 53 74 61 74 65 22 3A 32 nicationState”:2
00000040: 33 37 33 36 2C 22 4C 61 74 69 74 75 64 65 22 3A 3736,“Latitude”:
00000050: 33 33 2E 37 36 33 30 32 35 2C 22 4C 6F 6E 67 69 33.763025,“Longi
00000060: 74 75 64 65 22 3A 2D 31 31 38 2E 31 39 39 34 35 tude”:-118.19945
00000070: 38 33 33 33 33 33 33 33 33 2C 22 4D 65 73 73 61)
That’s a combination between Json and Binary (very usual) I need to convert those files, from dump binary to Json and then to String to get the Variable inside it! Do you have some idea? I got my files from websocket wss server.
Whoooh! That’s a tall order.
First you must parse/tokenize your json to get your variables broken down as separate entities. This should be relatively easy as there are a ton of json parsers around the internet.
Next you’ll have your values in “7B 22 4D …” format. At this point you should know what is the character encoding is (UTF-8, ASCII). Check your wss server documentation to figure how to reverse the encoding as it might be custom.
I strongly advice against doing this in blueprints. There are tons of readily available c++ libraries you can integrate in your project. (Your server probably comes with some too for decoding)