Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
McSwindler
Level 7

Extracting from a zip file and unicode

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.
0 Kudos
2 Replies
Roku Employee
Roku Employee

Re: Extracting from a zip file and unicode

"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.
    0 Kudos
    McSwindler
    Level 7

    Re: Extracting from a zip file and unicode

    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.
    0 Kudos