| [news.eclipse.tools.emf] Re: Platform URI and special chars in project name |
|
Sascha, You should always use URI.createPlatformURI(iFile.getFullPath().toString(), true) to ensure that special characters are encoded. For the IFile "/a#%b/model/a#%b.ecore" it would yield "platform:/resource/a%23%25b/a%23%25b.ecore", which is of course totally unreadable so in general you should avoid these characters like a bad disease. Even a space is bad enough and tends to throw all kinds of applications for a loop. The basic Ecore things I just tried worked fine for this scenario, but I still recommend against the practice since in my experience far too many utilities overlook doing either the encoding or the decoding either of which is likely to get you into trouble... Sascha Theves wrote: Hi all, we have several problems loading our model files when the project name does include special characters such as '#' or '%'. Thats because EMF resources are referenced by URIs. And in the URI implementation such special chars are used to separate the URI fragment etc... If you have a project with name 'My#Project' that confuses EMF. I think this is a general problem and not special to our models. Is there a workaround for the problem? Thanks in advance, Sascha |