[sword-cvs] icu-sword/source/extra/uconv Makefile.in,1.5,1.6 makedata.mak,1.4,1.5 uconv.1.in,1.3,1.4 uconv.cpp,1.4,1.5 uconv.dsp,1.4,1.5 uconv.vcproj,1.1,1.2 uwmsg.c,1.3,1.4
sword@www.crosswire.org
sword@www.crosswire.org
Tue, 6 Apr 2004 03:10:54 -0700
Update of /cvs/core/icu-sword/source/extra/uconv
In directory www:/tmp/cvs-serv8911/source/extra/uconv
Modified Files:
Makefile.in makedata.mak uconv.1.in uconv.cpp uconv.dsp
uconv.vcproj uwmsg.c
Log Message:
ICU 2.8 sync
Index: Makefile.in
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/uconv/Makefile.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile.in 10 Sep 2003 02:42:20 -0000 1.5
+++ Makefile.in 6 Apr 2004 10:08:40 -0000 1.6
@@ -1,6 +1,6 @@
## ******************************************************************************
## *
-## * Copyright (C) 1999-2000, International Business Machines
+## * Copyright (C) 1999-2003, International Business Machines
## * Corporation and others. All Rights Reserved.
## *
## *******************************************************************************
@@ -43,6 +43,10 @@
CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
+ifeq ($(PKGDATA_OPTS),)
+PKGDATA_OPTS = -O pkgdata.inc
+endif
+
## generic settings for data - common.
PKGMODE=common
INSTALLTO=$(DESTDIR)$(ICUDATA_DIR)
@@ -117,7 +121,7 @@
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(TARGET) : $(OBJECTS) $(UCONVMSG_LIB)
- $(LINK.cc) -o $@ $(OBJECTS) $(LIBS)
+ $(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS)
resfiles: $(RESFILES) package-resfiles
@@ -127,7 +131,7 @@
package-resfiles: $(RESDIR)/$(RESDIR).lst pkgdata.inc
- $(INVOKE) $(top_builddir)/tools/pkgdata/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
+ $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(top_builddir)/tools/pkgdata/pkgdata -p $(RESDIR) $(PKGDATA_OPTS) -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
$(RESDIR)/$(RESDIR).lst: Makefile pkgdata.inc $(srcdir)/resfiles.mk
@$(MKINSTALLDIRS) $(RESDIR)
@@ -158,8 +162,5 @@
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-# Don't do this. This is a problem when changing platforms.
-#ifneq ($(MAKECMDGOALS),distclean)
-#-include $(DEPS)
-#endif
+
Index: makedata.mak
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/uconv/makedata.mak,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- makedata.mak 10 Sep 2003 02:42:20 -0000 1.4
+++ makedata.mak 6 Apr 2004 10:08:40 -0000 1.5
@@ -1,5 +1,5 @@
#**********************************************************************
-#* Copyright (C) 1999-2000, International Business Machines Corporation
+#* Copyright (C) 1999-2003, International Business Machines Corporation
#* and others. All Rights Reserved.
#**********************************************************************
# nmake file for creating data files on win32
@@ -37,7 +37,7 @@
!ENDIF
!MESSAGE ICU path is $(ICUP)
RESNAME=uconvmsg
-RESDIR=. #$(ICUP)\..\icuapps\uconv\$(RESNAME)
+RESDIR=.
RESFILES=resfiles.mk
ICUDATA=$(ICUP)\data
@@ -50,20 +50,6 @@
DATA_PATH=$(ICUP)\data^\
ICUTOOLS=$(ICUP)\bin
-# We have to prepare params for pkgdata - to help it find the tools
-!IF "$(CFG)" == "Debug" || "$(CFG)" == "debug"
-PKGOPT=D:$(ICUP)
-!ELSE
-PKGOPT=R:$(ICUP)
-!ENDIF
-
-# This appears in original Microsofts makefiles
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
PATH = $(PATH);$(ICUP)\bin
# Suffixes for data files
@@ -86,41 +72,30 @@
OUTPUT = "$(DLL_OUTPUT)\$(RESNAME).lib"
!ENDIF
-ALL : GODATA $(OUTPUT) GOBACK #$(RESNAME).dat
+ALL : $(OUTPUT)
@echo All targets are up to date (mode $(PKGMODE))
# invoke pkgdata - static
-"$(DLL_OUTPUT)\$(RESNAME).lib" : $(RB_FILES) $(RESFILES)
+"$(DLL_OUTPUT)\$(RESNAME).lib" : $(RB_FILES) $(RESFILES)
@echo Building $(RESNAME).lib
- @"$(ICUTOOLS)\pkgdata" -f -v -m static -c -p $(RESNAME) -O "$(PKGOPT)" -d "$(DLL_OUTPUT)" -s "$(RESDIR)" <<pkgdatain.txt
+ @"$(ICUTOOLS)\pkgdata" -f -v -m static -c -p $(RESNAME) -d "$(DLL_OUTPUT)" -s "$(RESDIR)" <<pkgdatain.txt
$(RB_FILES:.res =.res
)
<<KEEP
-# utility to send us to the right dir
-GODATA :
-# cd "$(RESDIR)"
-
-# utility to get us back to the right dir
-GOBACK :
-# cd "$(RESDIR)\.."
-
# This is to remove all the data files
CLEAN :
- @cd "$(RESDIR)"
- -@erase "*.res"
- -@erase "uconvmsg*.*"
- -@erase "*.obj"
- -@erase "base*.*"
- @cd "$(ICUTOOLS)"
-@erase "$(RB_FILES)"
- -@"$(ICUTOOLS)\pkgdata" -f --clean -v -m static -c -p $(RESNAME) -O "$(PKGOPT)" -d "$(DLL_OUTPUT)" -s "$(RESDIR)" pkgdatain.txt
+ -@erase "$(RESDIR)\uconvmsg*.*"
+ -@erase "$(CFG)\*uconvmsg*.*"
+ -@"$(ICUTOOLS)\pkgdata" -f --clean -v -m static -c -p $(RESNAME) -d "$(DLL_OUTPUT)" -s "$(RESDIR)" pkgdatain.txt
# Inference rule for creating resource bundles
.txt.res:
@echo Making Resource Bundle files
- "$(ICUTOOLS)\genrb" -t -p $(RESNAME) -s $(@D) -d $(@D) $(?F)
+ "$(ICUTOOLS)\genrb" -t -p $(RESNAME) -s $(@D) -d $(@D) $(?F)
$(RESSRC) : {"$(ICUTOOLS)"}genrb.exe
+
Index: uconv.1.in
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/uconv/uconv.1.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- uconv.1.in 10 Sep 2003 02:42:20 -0000 1.3
+++ uconv.1.in 6 Apr 2004 10:08:41 -0000 1.4
@@ -2,11 +2,11 @@
.\"
.\" uconv.1: manual page for the uconv utility.
.\"
-.\" Copyright (C) 2000-2001 IBM, Inc. and others.
+.\" Copyright (C) 2000-2003 IBM, Inc. and others.
.\"
.\" Manual page by Yves Arrouye <yves@realnames.com>.
.\"
-.TH UCONV 1 "16 February 2002" "ICU MANPAGE" "ICU @VERSION@ Manual"
+.TH UCONV 1 "2003-dec-22" "ICU MANPAGE" "ICU @VERSION@ Manual"
.SH NAME
.B uconv
\- convert data from one encoding to another
@@ -67,6 +67,12 @@
.BI "\-t\fP, \fB\-\-to\-code" " encoding"
]
[
+.BI "\-\-add\-signature"
+]
+[
+.BI "\-\-remove\-signature"
+]
+[
.BI "\-o\fP, \fB\-\-output" " file"
]
[
@@ -114,14 +120,14 @@
The
.I transliteration
can be either a list of semicolon-separated transliterator names,
-or an arbitrary complex set of rules in the ICU transliteration
+or an arbitrarily complex set of rules in the ICU transliteration
rules format.
.PP
For transcoding purposes,
.B uconv
options are compatible with those of
.BR iconv (1),
-making it easy to replace it in scripts. It is not necessary the case,
+making it easy to replace it in scripts. It is not necessarily the case,
however, that the encoding names used by
.B uconv
and ICU are the same as the ones used by
@@ -240,6 +246,13 @@
Transcode the data to
.IR encoding .
.TP
+.BI "\-\-add\-signature"
+Add a U+FEFF Unicode signature character (BOM) if the output charset
+supports it and does not add one anyway.
+.TP
+.BI "\-\-remove\-signature"
+Remove a U+FEFF Unicode signature character (BOM).
+.TP
.BI "\-o\fP, \fB\-\-output" " file"
Write the transcoded data to
.IR file .
@@ -431,7 +444,7 @@
.SH VERSION
@VERSION@
.SH COPYRIGHT
-Copyright (C) 2001 IBM, Inc. and others.
+Copyright (C) 2000-2003 IBM, Inc. and others.
.SH SEE ALSO
.BR convrtrs.txt (5)
.br
Index: uconv.cpp
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/uconv/uconv.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- uconv.cpp 10 Sep 2003 02:42:20 -0000 1.4
+++ uconv.cpp 6 Apr 2004 10:08:41 -0000 1.5
@@ -14,12 +14,17 @@
* Conversion to the C conversion API and many improvements by
* Yves Arrouye <yves@realnames.com>, current maintainer.
*
+ * Markus Scherer maintainer from 2003.
+ * See source code repository history for changes.
*/
#include <unicode/utypes.h>
#include <unicode/ucnv.h>
+#include <unicode/uenum.h>
#include <unicode/unistr.h>
[...1125 lines suppressed...]
+ } else {
+ if (!cf.convertFile(
+ pname, fromcpage, toucallback, touctxt, tocpage,
+ fromucallback, fromuctxt, fallback, translit, 0,
+ outfile, verbose)
+ ) {
goto error_exit;
}
}
@@ -1073,8 +1378,9 @@
ret = 1;
normal_exit:
- if (outfile != stdout)
+ if (outfile != stdout) {
fclose(outfile);
+ }
return ret;
}
Index: uconv.dsp
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/uconv/uconv.dsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- uconv.dsp 10 Sep 2003 02:42:20 -0000 1.4
+++ uconv.dsp 6 Apr 2004 10:08:41 -0000 1.5
@@ -77,7 +77,6 @@
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
-# PROP Exclude_From_Build 1
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
MTL=midl.exe
@@ -91,6 +90,17 @@
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 icuucd.lib icuind.lib uconvmsg.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\lib" /libpath:"Debug"
+# Begin Custom Build
+ProjDir=.
+TargetPath=.\Debug\uconv.exe
+InputPath=.\Debug\uconv.exe
+InputName=uconv
+SOURCE="$(InputPath)"
+
+"$(ProjDir)\..\..\..\bin\$(InputName).exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ copy $(TargetPath) ..\..\..\bin
+
+# End Custom Build
!ELSEIF "$(CFG)" == "uconv - Win64 Release"
Index: uconv.vcproj
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/uconv/uconv.vcproj,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- uconv.vcproj 10 Sep 2003 02:42:20 -0000 1.1
+++ uconv.vcproj 6 Apr 2004 10:08:41 -0000 1.2
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="7.00"
+ Version="7.10"
Name="uconv"
SccProjectName=""
SccLocalPath="">
@@ -36,9 +36,9 @@
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"
- CommandLine="copy $(TargetPath) ..\..\..\bin
+ CommandLine="copy "$(TargetPath)" ..\..\..\bin
"
- Outputs="$(ProjectDir)..\..\..\bin\$(InputName).exe"/>
+ Outputs="$(ProjectDir)..\..\..\bin\$(TargetFileName)"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
@@ -65,7 +65,13 @@
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
@@ -92,7 +98,10 @@
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
- Name="VCCustomBuildTool"/>
+ Name="VCCustomBuildTool"
+ CommandLine="copy "$(TargetPath)" ..\..\..\bin
+"
+ Outputs="$(ProjectDir)..\..\..\bin\$(TargetFileName)"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
@@ -120,9 +129,17 @@
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
+ <References>
+ </References>
<Files>
<Filter
Name="Source Files"
@@ -160,7 +177,7 @@
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
- CommandLine="nmake /nologo /f $(InputName).mak icup=$(ProjectDir)..\..\.. CFG=Release
+ CommandLine="nmake /nologo /f $(InputName).mak icup="$(ProjectDir)..\..\.." CFG=Release
"
Outputs="Release/uconvmsg.lib"/>
</FileConfiguration>
@@ -168,7 +185,7 @@
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
- CommandLine="nmake /nologo /f $(InputName).mak icup=$(ProjectDir)..\..\.. CFG=Debug
+ CommandLine="nmake /nologo /f $(InputName).mak icup="$(ProjectDir)..\..\.." CFG=Debug
"
Outputs="Debug/uconvmsg.lib"/>
</FileConfiguration>
Index: uwmsg.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/uconv/uwmsg.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- uwmsg.c 10 Sep 2003 02:42:20 -0000 1.3
+++ uwmsg.c 6 Apr 2004 10:08:41 -0000 1.4
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1998-2000, International Business Machines Corporation
+* Copyright (C) 1998-2003, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
*
@@ -196,14 +196,20 @@
}
/* these will break if the # of messages change. simply add or remove 0's .. */
-UChar * gInfoMessages[U_ERROR_WARNING_LIMIT-U_ERROR_WARNING_START] =
- { 0,0 };
+UChar **gInfoMessages = NULL;
-UChar * gErrMessages[U_ERROR_LIMIT] =
- { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
+UChar **gErrMessages = NULL;
static const UChar *fetchErrorName(UErrorCode err)
{
+ if (!gInfoMessages) {
+ gInfoMessages = (UChar **)malloc((U_ERROR_WARNING_LIMIT-U_ERROR_WARNING_START)*sizeof(UChar*));
+ memset(gInfoMessages, 0, (U_ERROR_WARNING_LIMIT-U_ERROR_WARNING_START)*sizeof(UChar*));
+ }
+ if (!gErrMessages) {
+ gErrMessages = (UChar **)malloc(U_ERROR_LIMIT*sizeof(UChar*));
+ memset(gErrMessages, 0, U_ERROR_LIMIT*sizeof(UChar*));
+ }
if(err>=0)
return gErrMessages[err];
else