Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I organize my Japanese ebooks and manga using the respective Japanese titles as filenames. I then access this content from my Anrdoid device by mounting a cifs share with cifsmanager. However I cannot open the media using my Android 4.1 (AOSP) device. The non-ascii characters in my filesystem show up as just question marks, e.g. /mnt/sdcard/manga/??????/. The error behavior that various apps will give range from File does not exist (File Manager) to nothing at all (PerfectViewer).

share|improve this question
add comment

5 Answers

you will need to install a japanese font onto your device.

To do this, you would have to be rooted.

Another workaround: See if you can change the system language to Japanese.

You may be able to download an app from Google Play that will automatically install the font onto your device.

share|improve this answer
    
Other apps cannot install fonts on unrooted devices. –  THelper Nov 2 '12 at 11:56
    
@THelper I didn't say it could. I said you need to be rooted too install a font onto a device. –  Liam W Nov 2 '12 at 15:23
    
Ah, my bad. I thought you where mentioning a workaround for when not rooted. –  THelper Nov 2 '12 at 23:09
add comment

You are facing this issue because (as @liamwli said) you lack the required font and also possibly because of lack of sufficient libraries in your present ROM.

Due to this reason, it is unable to display the file name properly and as a ramification of this issue, different apps behave differently based on how the developer handled this situation.


What can be done?

This depends on few factors:

If your phone is rooted, extract DroidSansFallBack.ttf from /system/fonts folder to your computer and examine whether it has the required characters in Japanese. I assume you can read Japanese. This is to ensure the first part of the reason explained in "why" section.

If you do not have Japanese character displayed, please try finding a suitable TrueType Font (TTF) which displays Japanese characters in PC. Copy this file to the above said folder with DroidSansFallBack.ttf, replacing the existing file (after backup). After a reboot you may be able to see characters properly. Then the apps might be able to open the file.

In case if you are still unable to open such files, please revert back the backed up TTF file.

share|improve this answer
    
This looks promising, I'll try it out and let you know how it goes! –  briankb Nov 3 '12 at 2:57
add comment

If you are rooted I think the answer of Narayanan said it all; just copy a Japanese font to the system\fonts folder

However, if you are unrooted you can install a file explorer app that includes a Japanese font. I did a quick google search and the following file explorers (say that they) support Japanese:

I'm not entirely sure if this solves your problem opening the files. You might need to install viewer programs with Japanese support as well.

BTW, are you sure you have Android 4.1? I remember reading that Jelly Bean has (improved) native Japanese support.

share|improve this answer
1  
Android had always supported Japanese files. The improvement in 4.1 affects only the display of the characters. Characters that were previously rendered using Chinese glyphs are now rendered using Japanese-specific glyphs when the system locale is set to Japanese. The change does not affect how those characters are handled. –  Lie Ryan Nov 3 '12 at 0:22
    
I actually have 6 Android devices, but the specific device I'm using for reading Japanese content is a Kindle Fire with hashcode's Jelly Bean AOSP Rom (10.10 build). CM and AOKP based roms that I've tried also have the same behavior. I'll try these file managers out and let you know what happens. –  briankb Nov 3 '12 at 2:55
add comment

I do not think that this is a font issue. Applications do not need to be able to display the characters to handle files using those characters. Moreover, Droid Sans do support Japanese characters. In my stock Galaxy Nexus (not a Japanese phone), Japanese file names are handled and displayed fine using OI File Manager and ES File Explorer.

File names in Linux and Unix filesystems (e.g. ext2/ext3/ext4) are just sequence of bytes because the Linux kernel is encoding-transparent, i.e. the kernel does not care about filename encoding. Filename encoding is considered an application-level issue. In contrast, Java File API (and, therefore Android's Java File API) is encoding-aware and will attempt to decode file names according to system default encoding. The system default encoding in Android is utf-8. The situation is different if the files are stored in an SD card that is formatted using Windows filesystems, e.g. VFAT or NTFS. These filesystems specifies a certain on-disk encoding for file names.

Applications that directly handle files coming from another system, such as file transfer programs (FTP, etc) and decompression programs (Tar, Zip, etc) are supposed to translate file names from the remote systems or inside archives to the local system's default encoding. However, this isn't enforced by the kernel, so it is possible for poorly written (native) application to produce files with filename encoding that does not match system's default encoding.

My guess is that you have file names that are not encoded in utf-8, and the Java File API were not able to decode these filenames. Try to rename and reencode the file names or use a file transfer program that knows how to translate the filenames to the system encoding.

share|improve this answer
    
You're on the right track. It's not a font issue afterall. I blundered my original question by leaving out an important detail: I'm mounting my library using cifsmanager. Turns out if the content is copied directly to the device, it works fine. /faceplant –  briankb Nov 5 '12 at 12:58
add comment
up vote 2 down vote accepted

I should have identified that this problem only occurs when mounting the media remotely using cifsmanager. Better late than never, I suppose. The solution is to pass a parameter using the options field: iocharset=utf8.

The parameter tells the cifs module to use utf8 as the character set when it mounts the samba share. This may become unnecessary in the future, as it would make sense to have this set by default in the first place.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.