HI Michael,

Thanks for the explanation.  Moving the #if #else #endif block into
ConvertFilePathToColladaCompatibleURI does seem to be the correct
thing to do.

I have change it to start:

std::string ReaderWriterDAE::ConvertFilePathToColladaCompatibleURI(const
std::string& FilePath)
{
#ifdef OSG_USE_UTF8_FILENAME
    std::string path( cdom::nativePathToUri( FilePath ) );
#else
    std::string path( cdom::nativePathToUri(
osgDB::convertStringFromCurrentCodePageToUTF8(FilePath) ) );
#endif

And removed the conversion done in daeWMaterials.cpp.  Once I've
completed my review I'll check this in.

Thanks,
Robert.

On Fri, Jan 21, 2011 at 12:27 PM, Michael Platings <[email protected]> wrote:
> It looks correct to me. My understanding is:
>
> The Collada DOM uses UTF-8 and assumes that all strings passed to it will be
> UTF-8.
>
> - In the first case (OSG_USE_UTF8_FILENAME is defined) the filename is
> already UTF-8, so it can be converted straight to a URI.
> - In the second case (OSG_USE_UTF8_FILENAME not defined) the filename is
> using the current code page so must first be converted to UTF-8, then
> converted to a URI.
>
> My only suggestion is that this check should be moved into
> ConvertFilePathToColladaCompatibleURI itself.
>
> HTH
>
> On 21 January 2011 11:56, Robert Osfield <[email protected]> wrote:
>>
>> Hi Sukender,
>>
>> I have now merged the changes to osgDB with reservations - as we can
>> come back and fix the case issue later.
>>
>> I am currently review the changes to the dae plugin, and have come
>> across an #ifdef OSG_USE_UTF8_FILENAME block in daeWMaterials.cpp.  Is
>> this block supposed to be there?  The #if #else #endif also looks the
>> wrong way around to me, with the convert to UTF8 in the #else block.
>> The code is:
>>
>> #ifdef OSG_USE_UTF8_FILENAME
>>        fileURI =
>> ReaderWriterDAE::ConvertFilePathToColladaCompatibleURI(fileURI);
>> #else
>>        fileURI =
>> ReaderWriterDAE::ConvertFilePathToColladaCompatibleURI(
>> osgDB::convertStringFromCurrentCodePageToUTF8(fileURI) );
>> #endif
>>
>> What is your intention here?
>> Robert.
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to