Ok, here some more resources:

RegExp example:
 
http://www.devdaily.com/blog/post/java/remove-non-alphanumeric-characters-java-string

Windows filenames & paths:
 http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx

 - - -

On the other hand: how to deal with non-latin alphabets?
(that is, allowing Unicode file names? e.g. Japanese, Korean,
Cirillic, Greek, ... filenames?)

See for instance this: http://kourge.net/projects/regexp-unicode-block

Maybe in this case it would still be easier to go for the mouse-cat
solution which apparently is a bit less daunting...

... well, for now I'll stick with alphanumeric RegExp:
- good side: such files would be easier to index if made public
- downside: not everyone in the world knows a latin-alphabet based
language...?

--
Mathieu

On Aug 30, 12:37 pm, bdk <mathieu.b...@gmail.com> wrote:
> Hmm... Daniel, that's for sure the best approach!
>
> This one looks like nice option (using InputFilter):
>
>  http://stackoverflow.com/questions/5500060/android-input-type-for-onl...
>
> --
> Mathieu
>
> On Aug 30, 12:07 pm, Daniel Drozdzewski <daniel.drozdzew...@gmail.com>
> wrote:
>
> > On 30 August 2011 10:57, bdk <mathieu.b...@gmail.com> wrote:
>
> > > Thanks Chris, that's for sure useful :)
>
> > Mathieu,
>
> > Instead of doing cat and mouse chase of all possible path separators,
> > just define, what characters you allow in a reg-ex. This will be much
> > easier, as the file names have quite limited number of allowed chars.
>
> > It is true that System.getProperty("path.separator") or
> > File.pathSeparator will store the path separator for current locale.
> > But as you see, it will return only the separator for the current
> > locale, while you need to filter them all (I think).
>
> > In other words me defining the file path with Japanese Yen or Korean
> > Won while in "en" locale and then quitting your app, changing locale
> > to "jp" or "kr" and restarting your app could avoid your checks.
>
> > --
> > Daniel Drozdzewski
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to