Blockland Forums > Modification Help

How might one convert a BINARY FILE to a base64 string?

Pages: << < (7/8) > >>

Kalphiter:

I don't know how Torque decides to read the lines, but I think it uses the OS-specific line marker, \r\n, \r, and \n

Ipquarx:


--- Quote from: zmaster on June 21, 2012, 12:39:13 AM ---1. What kind of file are you trying to convert to a string?

2. while reading the file convert 0x00 to a newline?
--- End quote ---
1. look at the title.

2. You can't read 0x00. And even if you could, then what would newline be converted to?

Kalphiter:

Conclusion: Torque has poor file manipulation functions (why can't you read 100 bytes at a time or something, what if the new line characters are important for the file?) and limited string manipulation.

Lugnut:


--- Quote from: Kalphiter on June 21, 2012, 12:18:03 PM ---Conclusion: Torque has poor file manipulation functions (why can't you read 100 bytes at a time or something, what if the new line characters are important for the file?) and limited string manipulation.

--- End quote ---
:(

why did i have to learn torquescript first... it's a broken language :(

zmaster:


--- Quote from: Ipquarx on June 21, 2012, 11:50:27 AM ---1. look at the title.

2. You can't read 0x00. And even if you could, then what would newline be converted to?

--- End quote ---

A binary file could be a picture, model, music, etc.

newline is a delimiter,  like space or tab

Pages: << < (7/8) > >>

Go to full version