Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK! ×XòòMakefilenu„[µü¤# Copyright (C) 2016 and later: Unicode, Inc. and others. # License & terms of use: http://www.unicode.org/copyright.html#License # # Copyright (c) 2001-2004 IBM, Inc. and others # conversion sample code # Usage: # - configure and build ICU [see the docs] .. use "--prefix=" something # (I used --prefix=/home/srl/III ) # # - do 'make install' of icu # # - set the variable ICU_PREFIX to point at $(prefix) # (will look for $(prefix)/lib/icu/Makefile.inc ) # # - set the variable ICU_LEGACY (read the README) # ( Will look for ICU_LEGACY/include/unicode/ucol.h ) # # - do 'make' in this directory #ICU_PREFIX=/home/weiv/build/current #ICU_LEGACY = /home/weiv/build/icu-1-8-1 LEGACY_INCLUDE = $(ICU_LEGACY)/include ICU_INC=$(ICU_PREFIX)/lib/icu/Makefile.inc ICUPATH= -include $(ICU_INC) # Name of your target TARGET=legacy # All object files (C or C++) OBJECTS=legacy.o newcol.o oldcol.o CLEANFILES=*~ $(TARGET).out DEPS=$(OBJECTS:.o=.d) # turn on super warnings #CPPFLAGS += -Wall all: $(TARGET) $(ICU_INC) .PHONY: all clean distclean check report oldcol.o : oldcol.cpp $(LEGACY_INCLUDE)/unicode/ucol.h $(CXX) -I$(LEGACY_INCLUDE) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c oldcol.cpp distclean clean: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) -$(RMV) $(OBJECTS) $(TARGET) -$(RMV) $(DEPS) # Can change this to LINK.c if it is a C only program # Can add more libraries here. $(TARGET): $(OBJECTS) $(LINK.cc) -o $@ $^ $(ICULIBS) $(ICU_PREFIX)/lib/libicuuc.so.18 $(ICU_PREFIX)/lib/libicui18n.so.18 # Make check: simply runs the sample, logged to a file check: $(TARGET) $(INVOKE) ./$(TARGET) | tee $(TARGET).out # Make report: creates a 'report file' with both source and sample run report: $(TARGET).report $(TARGET).report: check $(TARGET).cpp more $(TARGET).cpp $(TARGET).out > $@ $(ICU_INC): @echo ICU_PREFIX variable is not set correctly @echo "Please read the directions at the top of this file (Makefile)" @echo "And the README" @echo "Can't open $(ICU_INC)" @false $(LEGACY_INCLUDE)/unicode/ucol.h: @echo ICU_LEGACY variable is not set correctly. @echo "Please read the directions at the top of this file (Makefile)" @echo "And the README" @echo "Can't open $@" @false ifneq ($(MAKECMDGOALS),distclean) -include $(DEPS) endif PK!ß"býý legacy.slnnu„[µü¤Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "legacy", "legacy.vcxproj", "{57F56795-1802-4605-88A0-013AAE9998F6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {57F56795-1802-4605-88A0-013AAE9998F6}.Debug|Win32.ActiveCfg = Debug|Win32 {57F56795-1802-4605-88A0-013AAE9998F6}.Debug|Win32.Build.0 = Debug|Win32 {57F56795-1802-4605-88A0-013AAE9998F6}.Debug|x64.ActiveCfg = Debug|x64 {57F56795-1802-4605-88A0-013AAE9998F6}.Debug|x64.Build.0 = Debug|x64 {57F56795-1802-4605-88A0-013AAE9998F6}.Release|Win32.ActiveCfg = Release|Win32 {57F56795-1802-4605-88A0-013AAE9998F6}.Release|Win32.Build.0 = Release|Win32 {57F56795-1802-4605-88A0-013AAE9998F6}.Release|x64.ActiveCfg = Release|x64 {57F56795-1802-4605-88A0-013AAE9998F6}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal PK!ú˜. %%legacy.vcxproj.filtersnu„[µü¤ {28feb3e5-286e-4bae-8a94-1831f7734250} cpp;c;cxx;rc;def;r;odl;idl;hpj;bat {82030ac6-467e-4020-a013-5b05ba72e3c8} h;hpp;hxx;hm;inl {f2650fcf-69b6-4d3c-b3ff-8eb4b63775c9} ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe Source Files Source Files Source Files PK!Qhç ç oldcol.cppnu„[µü¤/* ******************************************************************************* * * © 2016 and later: Unicode, Inc. and others. * License & terms of use: http://www.unicode.org/copyright.html#License * ******************************************************************************* ******************************************************************************* * * Copyright (C) 2001-2005, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: oldcol.cpp * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * created on: 2001jul24 * created by: Vladimir Weinstein */ /****************************************************************************** * This is the module that uses old collation ******************************************************************************/ #include #include #include #include // Very simple example code - sticks a sortkey in the buffer // Not much error checking int32_t getSortKey_legacy(const char *locale, const UChar *string, int32_t sLen, uint8_t *buffer, int32_t bLen) { UErrorCode status = U_ZERO_ERROR; UCollator *coll = ucol_open(locale, &status); if(U_FAILURE(status)) { return -1; } int32_t result = ucol_getSortKey(coll, string, sLen, buffer, bLen); ucol_close(coll); return result; } // This one can be used for passing to qsort function // Not thread safe or anything static UCollator *compareCollator = NULL; int compare_legacy(const void *string1, const void *string2) { if(compareCollator != NULL) { UCollationResult res = ucol_strcoll(compareCollator, (UChar *) string1, -1, (UChar *) string2, -1); if(res == UCOL_LESS) { return -1; } else if(res == UCOL_GREATER) { return 1; } else { return 0; } } else { return 0; } } void initCollator_legacy(const char *locale) { UErrorCode status = U_ZERO_ERROR; compareCollator = ucol_open(locale, &status); if(U_FAILURE(status)) { fprintf(stderr, "initCollator_legacy(%s): error opening collator, %s!\n", locale, u_errorName(status)); fprintf(stderr, "Note: ICU data directory is %s\n", u_getDataDirectory()); fprintf(stderr, "Read the README!\n"); exit(0); } } void closeCollator_legacy(void) { if(compareCollator != NULL) { ucol_close(compareCollator); } else { fprintf(stderr, "closeCollator_legacy(): collator was already NULL!\n"); } compareCollator = NULL; } extern "C" void test_legacy(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[4][32]) { uint32_t i = 0; int32_t keySize = 0; UVersionInfo uvi; u_getVersion(uvi); fprintf(stderr, "Entered legacy, version: [%d.%d.%d.%d]\nMoving to sortkeys\n", uvi[0], uvi[1], uvi[2], uvi[3]); for(i = 0; i #include #include "unicode/ucol.h" // Very simple example code - sticks a sortkey in the buffer // Not much error checking int32_t getSortKey_current(const char *locale, const UChar *string, int32_t sLen, uint8_t *buffer, int32_t bLen) { UErrorCode status = U_ZERO_ERROR; UCollator *coll = ucol_open(locale, &status); if(U_FAILURE(status)) { return -1; } int32_t result = ucol_getSortKey(coll, string, sLen, buffer, bLen); ucol_close(coll); return result; } // This one can be used for passing to qsort function // Not thread safe or anything static UCollator *compareCollator = NULL; int compare_current(const void *string1, const void *string2) { if(compareCollator != NULL) { UCollationResult res = ucol_strcoll(compareCollator, (UChar *) string1, -1, (UChar *) string2, -1); if(res == UCOL_LESS) { return -1; } else if(res == UCOL_GREATER) { return 1; } else { return 0; } } else { return 0; } } void initCollator_current(const char *locale) { UErrorCode status = U_ZERO_ERROR; compareCollator = ucol_open(locale, &status); } void closeCollator_current(void) { ucol_close(compareCollator); compareCollator = NULL; } extern "C" void test_current(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]) { uint32_t i = 0; int32_t keySize = 0; UVersionInfo uvi; u_getVersion(uvi); fprintf(stderr, "Entered current, version: [%d.%d.%d.%d]\nMoving to sortkeys\n", uvi[0], uvi[1], uvi[2], uvi[3]); for(i = 0; i Debug Win32 Debug x64 Release Win32 Release x64 {57F56795-1802-4605-88A0-013AAE9998F6} 8.1 Application false MultiByte v141 Application false MultiByte v141 Application false MultiByte v141 Application false MultiByte v141 <_ProjectFileVersion>10.0.30319.1 .\x86\Release\ .\x86\Release\ false .\x64\Release\ .\x64\Release\ false .\x86\Debug\ .\x86\Debug\ true .\x64\Debug\ .\x64\Debug\ true .\x86\Release/legacy.tlb OnlyExplicitInline ../../../include;%(AdditionalIncludeDirectories) WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreaded true true .\x86\Release/legacy.pch .\x86\Release/ .\x86\Release/ .\x86\Release/ Level3 true Default NDEBUG;%(PreprocessorDefinitions) 0x0409 icuuc.lib;icuin.lib;../../../../icu-1-8-1/lib/icuuc.lib;../../../../icu-1-8-1/lib/icuin.lib;%(AdditionalDependencies) .\x86\Release/legacy.exe true ../../../lib;%(AdditionalLibraryDirectories) .\x86\Release/legacy.pdb Console false X64 .\x64\Release/legacy.tlb OnlyExplicitInline ../../../include;%(AdditionalIncludeDirectories) WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreaded true true .\x64\Release/legacy.pch .\x64\Release/ .\x64\Release/ .\x64\Release/ Level3 true Default NDEBUG;%(PreprocessorDefinitions) 0x0409 icuuc.lib;icuin.lib;../../../../icu-1-8-1/lib/icuuc.lib;../../../../icu-1-8-1/lib/icuin.lib;%(AdditionalDependencies) .\x64\Release/legacy.exe true ../../../lib64;%(AdditionalLibraryDirectories) .\x64\Release/legacy.pdb Console false MachineX64 .\x86\Debug/legacy.tlb Disabled ../../../include;%(AdditionalIncludeDirectories) WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug true .\x86\Debug/legacy.pch .\x86\Debug/ .\x86\Debug/ .\x86\Debug/ Level3 true EditAndContinue Default _DEBUG;%(PreprocessorDefinitions) 0x0409 icuucd.lib;icuind.lib;../../../../icu-1-8-1/lib/icuucd.lib;../../../../icu-1-8-1/lib/icuind.lib;%(AdditionalDependencies) .\x86\Debug/legacy.exe true ../../../lib;%(AdditionalLibraryDirectories) true .\x86\Debug/legacy.pdb Console false X64 .\x64\Debug/legacy.tlb Disabled ../../../include;%(AdditionalIncludeDirectories) WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug true .\x64\Debug/legacy.pch .\x64\Debug/ .\x64\Debug/ .\x64\Debug/ Level3 true ProgramDatabase Default _DEBUG;%(PreprocessorDefinitions) 0x0409 icuucd.lib;icuind.lib;../../../../icu-1-8-1/lib/icuucd.lib;../../../../icu-1-8-1/lib/icuind.lib;%(AdditionalDependencies) .\x64\Debug/legacy.exe true ../../../lib64;%(AdditionalLibraryDirectories) true .\x64\Debug/legacy.pdb Console false MachineX64 ../../../include;../../../../icu-1-8-1/include ../../../include;../../../../icu-1-8-1/include ../../../include;../../../../icu-1-8-1/include ../../../include;../../../../icu-1-8-1/include PK!àâÝÉ É READMEnu„[µü¤Copyright (C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html#License Copyright (c) 2002, International Business Machines Corporation and others. All Rights Reserved. This example demonstrates running an instance of ICU 1.8.1. together with a current version of ICU. It only tests u_getVersion and several collation APIs. Generally, one should be able to simultaneously use one or more versions of ICU 2.0 or higher and one version of ICU 1.8.1 or lower. What is it all about: Let's say you have a 10 Tb database indexed using ICU 1.8.1. sortkeys. New ICU comes out, with neat new features you would like to use, but also with new sortkeys and you don't care to reindex your 10 Tb database. What to do then??? You can use ICU 1.8.1. in one of your compilation units and current version in all the others. So, you can use old collation until you decide to reindex. You cannot mix two versions of ICU in the same compilation unit. You cannot automatically use more than one legacy version of ICU. In order to make the compilation unit use old version of ICU, you have to do a couple of things: 1) change it's include path so that it includes header files from the old versions 2) explicitly add old libraries to the linker. 3) make sure old data can be found (if legacy code needs data). Building and running of the example: Linux: To make it work, you should build and install both the current ICU and ICU 1.8.1. Put both data libraries to wherever ICU_DATA points (usually it is $(prefix)/share/icu/$(icu_version)/). If data libraries are used, then check for $(prefix)/lib/icu/1.8.1 which should contain libicudata.so and libicudt18*.so 2. Copy libicuuc.so.18* and libicui18n.so.18* to $(prefix)/lib directory, together with current libraries). 3. Should work on other Unixes. Change $ICU_PREFIX to point to the current installation, and $ICU_LEGACY to point to 1.8.1 installation. $ICU_LEGACY is needed solely to access the 1.8.1 include directory through $LEGACY_INCLUDE variable, so if you want to move the 1.8.1. include directory, you can set $LEGACY_INCLUDE directly to that directory. Run make check. You should get two different libraries running at the same time. Win32: Build both current ICU and ICU 1.8.1. Take icuuc18.dll, icuin18.dll and icudt18l.dll and put them somewhere in PATH (a sane place would be wherever current dlls go). Edit the include directory for oldcol.cpp so that it points to the include directory of ICU 1.8.1. Edit the two library entries with path so that they point to .lib files for your version of ICU. Hit F7, followed by ctrl-F5. Troubleshooting (all platforms): Sample won't compile: this is quite unlikely, but the most probable reason is that include files cannot be found. Sample won't link: The path for 1.8.1. libraries is broken. Edit it so that it reflects the path to your libraries. Linker says: "Undefined symbol u_getVersion()" (or something similar): path to 1.8.1. libraries is bad. Linker says: "Undefined symbol u_getVersion()_X_Y" (or something similar): path to current libraries is bad. Legacy crashes horribly: Sorry, didn't put any error checking. If legacy crashes that's most probably because it cannot find the data libraries. You can see which data library is not found by the part of the program that is running. Make sure program can find tha data library either by putting it where ever ICU_DATA points to OR by putting the DLL version of the data library somewhere on your PATH. PK!lMl% % legacy.cppnu„[µü¤/* ******************************************************************************* * * © 2016 and later: Unicode, Inc. and others. * License & terms of use: http://www.unicode.org/copyright.html#License * ******************************************************************************* ******************************************************************************* * * Copyright (C) 2001 - 2005, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: main.cpp * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * created on: 2001jul24 * created by: Vladimir Weinstein */ /****************************************************************************** * main program demonstrating using two versions of ICU in the same project ******************************************************************************/ #include #include "unicode/utypes.h" #include "unicode/ustring.h" extern "C" void test_current(UChar data[][5], uint32_t size, uint32_t maxLen, uint8_t keys[][32]); extern "C" void test_legacy(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]); void printZTUChar(const UChar *str) { while(*str != 0) { if(*str > 0x1F && *str < 0x80) { fprintf(stdout, "%c", (*str) & 0xFF); } else { fprintf(stdout, "\\u%04X", *str); } str++; } } void printArray(const char* const comment, const UChar UArray[][5], int32_t arraySize) { fprintf (stdout, "%s\n", comment); int32_t i = 0; for(i = 0; i