Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this .
AeroMcFly
Prole
Posts: 2 Joined: Thu Dec 22, 2011 9:21 pm
Location: Ohio, United States
Post
by AeroMcFly » Fri Mar 16, 2012 12:54 am
First of all, I'm very new to Love2D. Very novice programmer. Currently using Love2D 0.8.0
I was just wondering, once you save a file encoded in Base64, how do you load that back and decode it?
Code: Select all
love.filesystem.setIdentity("DataTest")
newData = love.filesystem.newFileData("TEST","test.txt","base64")
love.filesystem.write("test.txt",newData)
local loaded = love.filesystem.read("test.txt") -- Problem
Marked "problem," it seems to not decode it back to 'TEST.' Does anyone know how to do this?
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Fri Mar 16, 2012 1:06 am
Firstly, it doesn't work like you think it works.
love.filesystem.newFileData de codes the first argument using Base64 if you specify it. So "TEST" becomes "LD�" in plain text. AFAIK, LÖVE provides no method to
en code to Base64.
Secondly, I'm curious, why do you want to use Base64?
miko
Party member
Posts: 410 Joined: Fri Nov 26, 2010 2:25 pm
Location: PL
Post
by miko » Fri Mar 16, 2012 7:47 am
AeroMcFly wrote:
I was just wondering, once you save a file encoded in Base64, how do you load that back and decode it?
Googling for "lua base64" yields
this , which you can use in your project.
vrld
Party member
Posts: 917 Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:
Post
by vrld » Fri Mar 16, 2012 10:33 am
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.
hump |
HC |
SUIT |
moonshine
AeroMcFly
Prole
Posts: 2 Joined: Thu Dec 22, 2011 9:21 pm
Location: Ohio, United States
Post
by AeroMcFly » Fri Mar 16, 2012 8:02 pm
Thanks guys
Users browsing this forum: No registered users and 2 guests