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

unicode file names not displaying correctly in history menu (kobo Aura HD issue) #354

Closed
hchaojie opened this issue Nov 3, 2013 · 2 comments

Comments

@hchaojie
Copy link

hchaojie commented Nov 3, 2013

see attached image, all unicode chars are displayed as "?",
my device: kobo Aura HD, language: english
if you guys need more information please let me know. thanks!

history

@hchaojie
Copy link
Author

hchaojie commented Nov 7, 2013

the problem seems to be in the FileManagerHistory and in the function readHistDir(). it uses "ls" to lists the history dir while the "ls" command could not recognize unicode file name (if system locale does not support that unicode chars)

Fortunately the lfs.dir() does not rely on system locale(that's what the FileChooser uses to list directory files and it works well). so the fix is to change the readHistDir to below:

for f in lfs.dir("./history") do
    local filemode = lfs.attributes(f, "mode")

    if filemode ~= "directory" then -- we can't use filemode == "file" here, when it should be "file" it is actually nil, weird
    table.insert(re, {
        dir = DocSettings:getPathFromHistory(f),
        name = DocSettings:getNameFromHistory(f),
    })
    end
end

@houqp
Copy link
Member

houqp commented Nov 7, 2013

good catch :)

Do you mind sending us a pull request?

hchaojie pushed a commit to hchaojie/koreader that referenced this issue Nov 8, 2013
hwhw added a commit that referenced this issue Nov 8, 2013
@houqp houqp closed this as completed Nov 9, 2013
houqp pushed a commit to houqp/koreader that referenced this issue Apr 24, 2017
build: remove cmake stamp files to force update target files
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

2 participants