Thread Subject: folder and file names with foreign characters

Subject: folder and file names with foreign characters

From: Fangjun Jiang

Date: 5 Feb, 2008 18:15:05

Message: 1 of 6

I have many data files in folders and sub-folders. All
these folder and file names contain foreign characters
(Chinese). They appear normal in Windows XP explorer. I
can copy and move files. But Matlab won't recognize these
folders and files. In Matlab command window, when I try to
change the current directory using the "Browse for folder"
button, I can choose the folder with the Chinese
characters (it displays the correct Chinese character),
but the command window shows:

??? Error using ==> cd
Cannot CD to C:\stdd\???? (Name is nonexistent or not a
directory).

When I double click a .txt file with Chinese character
file name, it pops up an error dialog indicating "file not
found". However, I can open it using notepad and it looks
fine. I saved the text file in all three types of unicode
but medit can't open it.

So the question is, can Matlab string contain foreign
characters? My need is to use a string to represent these
fold and file names and then do copy, move and stuff.

I am using R2007b in XP. Thanks!

Subject: folder and file names with foreign characters

From: dpb

Date: 5 Feb, 2008 18:28:47

Message: 2 of 6

Fangjun Jiang wrote:
...

> So the question is, can Matlab string contain foreign
> characters? My need is to use a string to represent these
> fold and file names and then do copy, move and stuff.

Sounds like a TMW support query, but a workaround _might_ be to get the
short filename for the files via the

DIR /X

switch and try using that instead of the full "long" filename.

I don't know whether XP would create a base font name or whether it
might still have other characters in the filename or not, but it's one
thing might try...

--

Subject: folder and file names with foreign characters

From: Fangjun Jiang

Date: 5 Feb, 2008 19:26:02

Message: 3 of 6

Thank you for the tip!

I tried one example in DOS command window. The file can be
copied and moved and the file name keeps the same (still
shows the correct Chinese character). This is good. What I
need next is to read the file name and extract a serial
number from it, combine the serial number with some other
Chinese characters and write it to a text file. It would
be perfect if Matlab could treat the file name as any
ordinary string. But it couldn't probably due to the fact
that the file name contains Chinese characters. I looked
for clues in unicode2native, native2unicode but couldn't
figure it out. Is there any solution? Thanks!

dpb <none@non.net> wrote in message <foaa57
$s4o$1@aioe.org>...
> Fangjun Jiang wrote:
> ...
>
> > So the question is, can Matlab string contain foreign
> > characters? My need is to use a string to represent
these
> > fold and file names and then do copy, move and stuff.
>
> Sounds like a TMW support query, but a workaround
_might_ be to get the
> short filename for the files via the
>
> DIR /X
>
> switch and try using that instead of the full "long"
filename.
>
> I don't know whether XP would create a base font name or
whether it
> might still have other characters in the filename or
not, but it's one
> thing might try...
>
> --

Subject: folder and file names with foreign characters

From: dpb

Date: 5 Feb, 2008 19:57:39

Message: 4 of 6

Fangjun Jiang wrote:
> Thank you for the tip!
>
> I tried one example in DOS command window. The file can be
> copied and moved and the file name keeps the same (still
> shows the correct Chinese character). This is good. What I
> need next is to read the file name and extract a serial
> number from it, combine the serial number with some other
> Chinese characters and write it to a text file. It would
> be perfect if Matlab could treat the file name as any
> ordinary string. But it couldn't probably due to the fact
> that the file name contains Chinese characters. I looked
> for clues in unicode2native, native2unicode but couldn't
> figure it out. Is there any solution? Thanks!
...

Don't know--I think this needs to go to TMW support directly.

A TMW person may see the query here, but this is unofficial (at best)
support forum, despite the interface available at the TMW site.

I don't have any way to test the problem (nor even a very recent copy of
ML), sorry...

--

Subject: folder and file names with foreign characters

From: Fangjun Jiang

Date: 7 Feb, 2008 14:06:03

Message: 5 of 6

I got tech support from TMW and it works now.

I am writing in reference to your Service Request # 1-
5QA9X3 regarding ' folder and file names with foreign
characters'. Could you please ensure that both the user
and the system Locale Settings in Windows are set to
Chinese? MATLAB requires that they are the same.

The user settings can be found by going to:

Start->Control Panel->Regional and Language Options-
>Regional Options

Set the dropdown box appropriately. The system settings
are in the "Advanced" tab of the same window.

You will probably have to restart your computer for any
changes to take effect. Please let me know if this works
or not.


dpb <none@non.net> wrote in message <foafbp$de8
$1@aioe.org>...
> Fangjun Jiang wrote:
> > Thank you for the tip!
> >
> > I tried one example in DOS command window. The file
can be
> > copied and moved and the file name keeps the same
(still
> > shows the correct Chinese character). This is good.
What I
> > need next is to read the file name and extract a
serial
> > number from it, combine the serial number with some
other
> > Chinese characters and write it to a text file. It
would
> > be perfect if Matlab could treat the file name as any
> > ordinary string. But it couldn't probably due to the
fact
> > that the file name contains Chinese characters. I
looked
> > for clues in unicode2native, native2unicode but
couldn't
> > figure it out. Is there any solution? Thanks!
> ...
>
> Don't know--I think this needs to go to TMW support
directly.
>
> A TMW person may see the query here, but this is
unofficial (at best)
> support forum, despite the interface available at the
TMW site.
>
> I don't have any way to test the problem (nor even a
very recent copy of
> ML), sorry...
>
> --

Subject: folder and file names with foreign characters

From: dpb

Date: 7 Feb, 2008 15:47:02

Message: 6 of 6

Fangjun Jiang wrote:
> I got tech support from TMW and it works now.
>
...
> ...ensure that both the user and the system Locale Settings in Windows ...

That's why I recommended that route... :)

I've fiddled w/ Winders locale settings and fonts, etc., that had
suspicion the problems lay there, but not sufficient ottomh knowledge as
to tell you what/where to look for sure...

--

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
unicode Fangjun Jiang 5 Feb, 2008 13:20:10
foreign character Fangjun Jiang 5 Feb, 2008 13:20:10
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com