CCDictionary::createWithContentsOfFile() crashes when trying to load a UTF-16 encoded file

The subject says it all really. On Android using the latest code from Github, attempting to load a UTF-16 encoded plist file with CCDictionary::createWithContentsOfFile() will cause a crash. Encoding the files with UTF-8 appears to not cause the same problem. This issue doesn’t appear to happen on iOS.

Here’s the ndk-stack dump:

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000c Stack frame #00 pc 000d51d0 /data/app-lib/org.company.product/libgame.so (cocos2d::CCObject::release()+19): Routine __static_initialization_and_destruction_0 in /Users/username/Development/ProductName/proj.android/../../cocos2dx/cocos2dx/cocoa/CCGeometry.h:100 Stack frame #01 pc 000fb87b /data/app-lib/org.company.product/libgame.so (cocos2d::ccArrayAppendObject(cocos2d::_ccArray*, cocos2d::CCObject*)+8): Routine ccArrayAppendArray in /Users/username/Development/ProductName/proj.android/../../cocos2dx/cocos2dx/support/data_support/ccCArray.cpp:137 Stack frame #02 pc 000fb89f /data/app-lib/org.company.product/libgame.so (cocos2d::ccArrayAppendObjectWithResize(cocos2d::_ccArray*, cocos2d::CCObject*)+16): Routine ccArrayInsertObjectAtIndex in /Users/username/Development/ProductName/proj.android/../../cocos2dx/cocos2dx/support/data_support/ccCArray.cpp:152 Stack frame #03 pc 000d5bd1 /data/app-lib/org.company.product/libgame.so (cocos2d::CCArray::addObject(cocos2d::CCObject*)+4): Routine copyWithZone in /Users/username/Development/ProductName/proj.android/../../cocos2dx/cocos2dx/cocoa/CCArray.cpp:392 Stack frame #04 pc 000d357b /data/app-lib/org.company.product/libgame.so (cocos2d::CCAutoreleasePool::addObject(cocos2d::CCObject*)+6): Routine clear in /Users/username/Development/ProductName/proj.android/../../cocos2dx/cocos2dx/cocoa/CCAutoreleasePool.cpp:69 Stack frame #05 pc 000d3737 /data/app-lib/org.company.product/libgame.so (cocos2d::CCPoolManager::addObject(cocos2d::CCObject*)+10): Routine CCDictElement in /Users/username/Development/ProductName/proj.android/../../cocos2dx/cocos2dx/cocoa/CCDictionary.cpp:37 Stack frame #06 pc 000d51e3 /data/app-lib/org.company.product/libgame.so (cocos2d::CCObject::autorelease()+10): Routine __static_initialization_and_destruction_0 in /Users/username/Development/ProductName/proj.android/../../cocos2dx/cocos2dx/cocoa/CCObject.cpp:118 Stack frame #07 pc 000d4c99 /data/app-lib/org.company.product/libgame.so (cocos2d::CCDictionary::createWithContentsOfFile(char const*)+8): Routine ~vector in /Users/username/Development/android-ndk-r8d/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_construct.h:94

It happens in ios as well , i resolved this by reading plist info into native nsdictionary first and converting it to ccdictionary