Topic: Write/Read File having Japanese characters as file name

Hi

My requirement is to create new files by names from database(UTF8
encoded for multi language support).

Mostly Japanese langauge support. I need to create file for each project
with project name. Sometimes the project name will be in Japanese.

In such case i could not generate file name with "Japanese characters go here.txt".

I am getting always garbage characters as file name ex:
事由別バグレポートtest.txt

Awaiting for your help. Thanks in advance.

Regards,
Sudheendra

Last edited by psudheendra (2010-07-08 07:33:20)

Re: Write/Read File having Japanese characters as file name

It's nothing to do with the database - filesystems generally don't support UTF-8.  You'll need to convert the names to ASCII before you create the files, which means you'd need to store the file's ascii name in the database so you know which record goes with which file.  And if you're doing that, you might as well just give the files a unique filename (eg using the record's unique id field) and hide the filename from the user completely: this will be more robust and simple than translating them.

###########################################
#If i've helped you then please recommend me at Working With Rails:
#http://www.workingwithrails.com/person/ … i-williams