Skip to content

index fails when non-US-ASCII filename encountered #27

Closed
listrophy opened this Issue Nov 11, 2011 · 8 comments

2 participants

@listrophy
pair@harkness:~/dev/play(master+)$ bin/play index
/Users/pair/dev/play/lib/play/library.rb:20:in `split': invalid byte sequence in US-ASCII (ArgumentError)
    from /Users/pair/dev/play/lib/play/library.rb:20:in `fs_songs'
    from /Users/pair/dev/play/lib/play/library.rb:30:in `import_songs'
    from bin/play:41:in `block in index_music'
    from bin/play:41:in `fork'
    from bin/play:41:in `index_music'
    from bin/play:62:in `<main>'
@listrophy

I fixed it by inserting

Encoding.default_external = 'utf-8'

above line 20 of lib/play/library.rb

I'd submit a patch, but I'm not sure where that line is supposed to go.

@holman holman added a commit that closed this issue Nov 11, 2011
@holman holman set encoding (closes #27) 5e8a63c
@holman holman closed this in 5e8a63c Nov 11, 2011
@holman
Play member
holman commented Nov 11, 2011

I'm going to try the magic comment on this instead; if you could, could you check it and see if that indexes fine for you?

Thanks for digging into this; I have a pretty large library but haven't run into this yet.

@listrophy

I've tried inserting the

# encoding: utf-8

at the top of that file to no avail. It seemed that the

Encoding.default_external = 'utf-8'

was required.

@holman holman added a commit that referenced this issue Nov 11, 2011
@holman holman force encoding (#27) 333f826
@holman
Play member
holman commented Nov 11, 2011

I added that explicitly.

Are you using 1.9.x? I'm catching some weird segfaults on 1.9.3 (presumably with some of the audio indexing third party gems I'm using). I think I might force 1.8.7 for now.

@holman holman added a commit that referenced this issue Nov 11, 2011
@holman holman Revert "force encoding (#27)"
This reverts commit 333f826.
6f397cc
@holman
Play member
holman commented Nov 11, 2011

Yeah, I'm going to yank this; 1.8.7 is where play will run for now.

@listrophy

Hrm. Well, we're using play on ruby 1.9.2-p290, and simply adding the Encoding line works. Haven't tested 1.8.x.

@holman
Play member
holman commented Nov 11, 2011

The Encoding call breaks in non-1.9 environments. We can work around it, but I think the entire library needs a lot more thought for 1.9 before we move that direction. I'll punt on it until then.

@listrophy

roger dodger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.