Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename encoding issue #17

Closed
glennjones opened this issue Dec 29, 2014 · 4 comments
Closed

Filename encoding issue #17

glennjones opened this issue Dec 29, 2014 · 4 comments
Assignees

Comments

@glennjones
Copy link

Hi,

I am trying out the example sd-card code and the file writes to the sd-card, but the file name is encoded incorrectly. This means I can not read it back again and get the error.

/app/microsd.js:19: attempt to index local 'data' (a nil value)

@johnnyman727
Copy link
Contributor

Hey Glen, thanks for reporting this. It may or not be the same issue that others have been reporting which I encapsulated in #18. @natevw is going to look into it.

@natevw natevw self-assigned this Dec 30, 2014
@natevw
Copy link
Owner

natevw commented Dec 30, 2014

This is indeed very likely due to an encoding trouble. I've more directly isolated a problem using the struct-fu test suite which is failing on Tessel again — that library is used by sdcard and fatfs for reading and writing binary fields.

Filed tessel/t1-runtime#690 — the firmware recently got some improved support for Buffer encoding but one spot was missed. I'll work with the TM folks to get a fix out and/or keep struct-fu working with the new situation.

Local workaround

You can work around temporarily by changing this line in your project's "node_modules/sdcard/node_modules/fatfs/node_modules/struct-fu/lib.js":

if (Buffer("\ud83c\udf91", 'utf16le')[0] !== 0x3c) require("./_workaround_tessel_358.js");

to:

if (1 || Buffer("\ud83c\udf91", 'utf16le')[0] !== 0x3c) require("./_workaround_tessel_358.js");

@glennjones
Copy link
Author

Thanks Nathan, your workaround sorted out the issue for me.

@natevw
Copy link
Owner

natevw commented Mar 3, 2015

Tessel now has built-in support for the utf16le buffer encoding (tessel/t1-runtime#645) and so this issue is likely resolved. (IIRC struct-fu also got an interim fix for this.) Thanks for your original report!

@natevw natevw closed this as completed Mar 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants