annotate audio/private/jfile.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
author |
samer |
date |
Sun, 11 Oct 2015 10:20:42 +0100 |
parents |
62e31e7980e6 |
children |
|
rev |
line source |
samer@43
|
1 % jfile - construct Java File object from path string
|
samer@43
|
2 % jfile :: text -> java.io.File.
|
samer@0
|
3 function f=jfile(path)
|
samer@0
|
4 % The problem was that file names with accents in where not being found
|
samer@0
|
5 % when converted to Java file names.
|
samer@0
|
6 % I have no idea what is going on here but it seems to work
|
samer@43
|
7 % f=java.io.File(java.lang.String(unicode2native(path,'latin1'),'UTF8'));
|
samer@43
|
8
|
samer@43
|
9 % SA 2014: UPDATE
|
samer@43
|
10 % Now I have a faint idea about what is going on here. Matlab ignores the
|
samer@43
|
11 % LANG environment variable, and previously was using LATIN1 as it's
|
samer@43
|
12 % feature('DefaultCharacterSet'). This meant that the entire Java subsystem
|
samer@43
|
13 % was starting up with LATIN1 as its chacterset. Now, I have found a way
|
samer@43
|
14 % to persuade Matlab to use Unicode, and indeed, for the JVM to use unicode
|
samer@43
|
15 % also. This means that the old version of this function was no good.
|
samer@43
|
16 % Instead, we should use unicode2native with no 2nd argument.
|
samer@43
|
17 f=java.io.File(java.lang.String(unicode2native(path),'UTF8'));
|