Your Digital Media Has Never Looked So Good

 
McSwindler
Topic Author
Posts: 2
Joined: Mon Nov 10, 2014 5:02 pm

Extracting from a zip file and unicode

Mon Nov 10, 2014 5:20 pm

I just started looking at the SDK to try and port over an addon that I've made for XBMC (I don't actually own a Roku atm, but a few of my friends had interest in my addon and they all do [plus I got bored])
The initial information download I have as a zip file and extract several json files from that and store them locally.

Looking through the documentation on BrightScript I am not seeing much support for anything besides text files, and it appears to only be ascii at that. All I see is the global 'ReadAsciiFile'.
I have 2 questions before I start fully diving into developing in case I need to restructure my API a wee bit.
  1. Is there a way to extract files from a zip archive? Bonus points if it can be done in memory, as in extracting the files without having to save the zip file first after downloading.
  2. Does ReadAsciiFile only support ascii characters, and if so, is there another method to read in utf-8 characters? My json files do contain some special, non-ascii characters.

Thanks in advance!

PS: Before someone says 'well, how are you going to develop if you don't own a Roku?' I am going to be purchasing one soon enough...
PSS: I did try to search for my zip query hoping it was already said somewhere how, but it was like finding a needle in a haystack weeding through all the issues on the actual channel zip file. So, I apologize if it has been mentioned and resolved previously.
 
User avatar
RokuKC
Posts: 315
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: Extracting from a zip file and unicode

Mon Nov 10, 2014 7:21 pm

McSwindler wrote:
[*]Does ReadAsciiFile only support ascii characters, and if so, is there another method to read in utf-8 characters? My json files do contain some special, non-ascii characters.


Despite the name, ReadAsciiFile works implicitly with UTF-8 encoded files.
 
McSwindler
Topic Author
Posts: 2
Joined: Mon Nov 10, 2014 5:02 pm

Re: Extracting from a zip file and unicode

Wed Nov 12, 2014 11:26 am

Thanks for that info on the UTF-8 support.

I decided to go ahead and re-jigger (yes, that's the technical term) my API to no longer use the zip, so this is no longer an issue.

Who is online

Users browsing this forum: No registered users and 5 guests