filename problem
3 posters
Page 1 of 1
filename problem
xploreME! is so wonderful:D,
but it seens like have a little problem (a big problem to me ),
when i use chinese character (UTF-8 format) as the filename or path (such as 音樂 )
,then the mediafile(mp3,3gp,etc..) will NOT be playable anymore,
hope you can done the support to UTF-8 filename or folder name,
thanks a lot!
but it seens like have a little problem (a big problem to me ),
when i use chinese character (UTF-8 format) as the filename or path (such as 音樂 )
,then the mediafile(mp3,3gp,etc..) will NOT be playable anymore,
hope you can done the support to UTF-8 filename or folder name,
thanks a lot!
ericsheu- Number of posts : 2
Country : taipei
Registration date : 2007-10-18
Re: filename problem
im not sure how it can be done.. it is very problematic to fix that bug, i donno what string your phone returns, ill see if i can do something about it but im doubt...
Re: filename problem
ThaPhoeniX wrote:im not sure how it can be done.. it is very problematic to fix that bug, i donno what string your phone returns, ill see if i can do something about it but im doubt...
I know a application call "KD Player". It supported UTF-8 format file/folder name. I have use that application on my SE K550 now.
Here is the application website: http://www.kdpro.dev.juga.ru/
Hope this can help you.
jason.lkk- Active Member
- Number of posts : 10
Country : malaysia
Registration date : 2007-10-16
Re: filename problem
ericsheu wrote:xploreME! is so wonderful:D,
but it seens like have a little problem (a big problem to me ),
when i use chinese character (UTF-8 format) as the filename or path (such as 音樂 )
,then the mediafile(mp3,3gp,etc..) will NOT be playable anymore,
hope you can done the support to UTF-8 filename or folder name,
thanks a lot!
can you the the correct names on the browser?
Re: filename problem
sorry for see your reply lately,
I've used KD Player before, but it has the same problem,
all songs will not be playable when named as UTF8 format,
i've searching on the web and found a similar java program,
it probably has some key can cause to the problem,
but i'm not sure where the information helpful to you or not~
following java including some simplified chinese character,
it's just a remark section, you can ignore it...
I've used KD Player before, but it has the same problem,
all songs will not be playable when named as UTF8 format,
i've searching on the web and found a similar java program,
it probably has some key can cause to the problem,
but i'm not sure where the information helpful to you or not~
following java including some simplified chinese character,
it's just a remark section, you can ignore it...
- public static String getAppPath(Class cls){
- //检查用户传入的参数是否为空
- if(cls==null) </SPAN>
- throw new java.lang.IllegalArgumentException("参数不能为空!"); </SPAN>
- ClassLoader loader=cls.getClassLoader();
- //获得类的全名,包括包名 </SPAN>
- String clsName=cls.getName()+".class"; </SPAN>
- //获得传入参数所在的包 </SPAN>
- Package pack=cls.getPackage();
- String path=""; </SPAN>
- //如果不是匿名包,将包名转化为路径 </SPAN>
- if(pack!=null){ </SPAN>
- String packName=pack.getName();
- //此处简单判定是否是Java基础类库,防止用户传入JDK内置的类库 </SPAN>
- if(packName.startsWith("java.")||packName.startsWith("javax.")) </SPAN>
- throw new java.lang.IllegalArgumentException("不要传送系统类!"); </SPAN>
- //在类的名称中,去掉包名的部分,获得类的文件名 </SPAN>
- clsName=clsName.substring(packName.length()+1); </SPAN>
- //判定包名是否是简单包名,如果是,则直接将包名转换为路径, </SPAN>
- if(packName.indexOf(".")<0) path=packName+"/"; </SPAN>
- else{//否则按照包名的组成部分,将包名转换为路径 </SPAN>
- int start=0,end=0; </SPAN>
- end=packName.indexOf("."); </SPAN>
- while(end!=-1){ </SPAN>
- path=path+packName.substring(start,end)+"/"; </SPAN>
- start=end+1; </SPAN>
- end=packName.indexOf(".",start); </SPAN>
- }
- path=path+packName.substring(start)+"/"; </SPAN>
- }
- }
- //调用ClassLoader的getResource方法,传入包含路径信息的类文件名 </SPAN>
- java.net.URL url =loader.getResource(path+clsName);
- //从URL对象中获取路径信息 </SPAN>
- String realPath=url.getPath();
- //去掉路径信息中的协议名"file:" </SPAN>
- int pos=realPath.indexOf("file:"); </SPAN>
- if(pos>-1) realPath=realPath.substring(pos+5); </SPAN>
- //去掉路径信息最后包含类文件信息的部分,得到类所在的路径 </SPAN>
- pos=realPath.indexOf(path+clsName);
- realPath=realPath.substring(0,pos-1); </SPAN>
- //如果类文件被打包到JAR等文件中时,去掉对应的JAR等打包文件名 </SPAN>
- if(realPath.endsWith("!")) </SPAN>
- realPath=realPath.substring(0,realPath.lastIndexOf("/")); </SPAN>
- /*------------------------------------------------------------ </SPAN>
- ClassLoader的getResource方法使用了utf-8对路径信息进行了编码,当路径
- 中存在中文和空格时,他会对这些字符进行转换,这样,得到的往往不是我们想要
- 的真实路径,在此,调用了URLDecoder的decode方法进行解码,以便得到原始的
- 中文及空格路径
- -------------------------------------------------------------*/
- try{ </SPAN>
- realPath=java.net.URLDecoder.decode(realPath,"utf-8"); </SPAN>
- }catch(Exception e){throw new RuntimeException(e);} </SPAN>
- return realPath; </SPAN>
- }//getAppPath定义结束 </SPAN>
- /-----------------------------------------------------------------
ericsheu- Number of posts : 2
Country : taipei
Registration date : 2007-10-18
Similar topics
» XploreME! v4.1 feedbacks and request
» VERY BIG PROBLEM WITH MY V3X!
» Picture Problem
» Problem v3xx
» V3X-E1070-V1075 Unlock completle java permission!
» VERY BIG PROBLEM WITH MY V3X!
» Picture Problem
» Problem v3xx
» V3X-E1070-V1075 Unlock completle java permission!
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum