Created
December 13, 2011 21:36
-
-
Save springmeyer/1474002 to your computer and use it in GitHub Desktop.
test icu's Collator::createInstance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# *** this fails *** | |
BUILD="/opt/icu4_8" | |
export DYLD_LIBRARY_PATH=/opt/icu4_8/lib | |
export ARCH_FLAGS="-arch x86_64 -arch i386" | |
export CFLAGS=$ARCH_FLAGS | |
export CXXFLAGS=$CFLAGS | |
export LDFLAGS=$ARCH_FLAGS | |
./runConfigureICU MacOSX --prefix=${BUILD} && make -j6 && make install | |
clang++ -o icutest icutest.cpp -I${BUILD}/include/ -L${BUILD}/lib -licuuc -licui18n | |
./icutest | |
en_US | |
Collator failed to initialize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unicode/utypes.h> | |
#include <unicode/uchar.h> | |
#include <unicode/coll.h> | |
#include <iostream> | |
#include <iomanip> | |
int main() | |
{ | |
U_NAMESPACE_QUALIFIER Locale l; | |
std::cout << l.getName() << std::endl; | |
UErrorCode success = U_ZERO_ERROR; | |
U_NAMESPACE_QUALIFIER Collator* pcol = U_NAMESPACE_QUALIFIER Collator::createInstance(l, success); | |
if(U_SUCCESS(success) == 0) | |
{ | |
std::cout << "Collator failed to initialize" << std::endl; | |
exit(1); | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# *** this works *** | |
BUILD="/opt/icu4_8" | |
export DYLD_LIBRARY_PATH=/opt/icu4_8/lib | |
export ARCH_FLAGS="-arch x86_64" | |
export CFLAGS=$ARCH_FLAGS | |
export CXXFLAGS=$CFLAGS | |
export LDFLAGS=$ARCH_FLAGS | |
./runConfigureICU MacOSX --prefix=${BUILD} && make -j6 && make install | |
clang++ -o icutest icutest.cpp -I${BUILD}/include/ -L${BUILD}/lib -licuuc -licui18n | |
en_US |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment