├── IDNSDK-1.1.0 ├── api │ ├── build │ │ └── Makefile │ ├── c │ │ ├── Win32-Projects │ │ │ ├── XCode.dsw │ │ │ ├── headerexport │ │ │ │ ├── headerexport.dsp │ │ │ │ └── headerexport.mak │ │ │ ├── test │ │ │ │ ├── charmap │ │ │ │ │ ├── charmap.dsp │ │ │ │ │ └── charmap.mak │ │ │ │ ├── domains │ │ │ │ │ ├── domains.dsp │ │ │ │ │ └── domains.mak │ │ │ │ ├── fullcircle │ │ │ │ │ ├── fullcircle.dsp │ │ │ │ │ ├── fullcircle.mak │ │ │ │ │ └── fullcircle.txt │ │ │ │ ├── idna │ │ │ │ │ ├── idna.dsp │ │ │ │ │ └── idna.mak │ │ │ │ ├── nameprep │ │ │ │ │ ├── nameprep.dsp │ │ │ │ │ └── nameprep.mak │ │ │ │ ├── prohibit │ │ │ │ │ ├── prohibit.dsp │ │ │ │ │ └── prohibit.mak │ │ │ │ ├── punycode │ │ │ │ │ ├── punycode.dsp │ │ │ │ │ └── punycode.mak │ │ │ │ ├── race │ │ │ │ │ ├── race.dsp │ │ │ │ │ └── race.mak │ │ │ │ ├── sampleuse │ │ │ │ │ ├── sampleuse.dsp │ │ │ │ │ └── sampleuse.mak │ │ │ │ ├── unicode │ │ │ │ │ ├── unicode.dsp │ │ │ │ │ └── unicode.mak │ │ │ │ └── utf8 │ │ │ │ │ ├── utf8.dsp │ │ │ │ │ └── utf8.mak │ │ │ ├── xcodedll │ │ │ │ ├── StdAfx.cpp │ │ │ │ ├── StdAfx.h │ │ │ │ ├── resource.h │ │ │ │ ├── xcode.aps │ │ │ │ ├── xcode.rc │ │ │ │ ├── xcodedll.cpp │ │ │ │ ├── xcodedll.dsp │ │ │ │ └── xcodedll.mak │ │ │ └── xcodelib │ │ │ │ ├── xcodelib.dsp │ │ │ │ └── xcodelib.mak │ │ ├── build │ │ │ └── Makefile │ │ ├── test │ │ │ ├── Makefile │ │ │ ├── charmap │ │ │ │ └── charmap.c │ │ │ ├── domains │ │ │ │ └── domains.c │ │ │ ├── fullcircle │ │ │ │ └── fullcircle.c │ │ │ ├── idna │ │ │ │ └── idna.c │ │ │ ├── nameprep │ │ │ │ └── nameprep.c │ │ │ ├── prohibit │ │ │ │ └── prohibit.c │ │ │ ├── punycode │ │ │ │ └── punycode.c │ │ │ ├── race │ │ │ │ └── race.c │ │ │ ├── sampleuse │ │ │ │ └── examples.c │ │ │ ├── unicode │ │ │ │ └── unicode.c │ │ │ ├── utf8 │ │ │ │ └── utf8.c │ │ │ └── utility │ │ │ │ └── utility.h │ │ └── xcode │ │ │ ├── headerexport │ │ │ ├── headerexport.c │ │ │ ├── headergen.h │ │ │ └── headergenrfc.c │ │ │ ├── inc │ │ │ ├── adapter.h │ │ │ ├── nameprep.h │ │ │ ├── puny.h │ │ │ ├── race.h │ │ │ ├── staticdata │ │ │ │ ├── nameprep_bidi_lcat.h │ │ │ │ ├── nameprep_bidi_randalcat.h │ │ │ │ ├── nameprep_charmap.h │ │ │ │ ├── nameprep_compatible.h │ │ │ │ ├── nameprep_compose.h │ │ │ │ ├── nameprep_cononical.h │ │ │ │ ├── nameprep_data.h │ │ │ │ ├── nameprep_datastructures.h │ │ │ │ ├── nameprep_decompose.h │ │ │ │ ├── nameprep_lookups.h │ │ │ │ ├── nameprep_prohibit.h │ │ │ │ └── nameprep_prohibit_allowunassigned.h │ │ │ ├── toxxx.h │ │ │ ├── util.h │ │ │ ├── xcode.h │ │ │ └── xcode_config.h │ │ │ └── src │ │ │ ├── nameprep.c │ │ │ ├── puny.c │ │ │ ├── race.c │ │ │ ├── toxxx.c │ │ │ └── util.c │ ├── data │ │ ├── BidiL.txt.gz │ │ ├── BidiOther.txt.gz │ │ ├── BidiProhibit.txt.gz │ │ ├── BidiRAL.txt.gz │ │ ├── Charmap.txt.gz │ │ ├── CompositionExclusions.txt.gz │ │ ├── ErrorCodes.txt │ │ ├── Illegal.txt.gz │ │ ├── NormalizationTest.txt.gz │ │ ├── Prohibit.txt.gz │ │ ├── Unassigned.txt.gz │ │ └── UnicodeData.txt.gz │ └── java │ │ ├── build │ │ ├── Makefile │ │ ├── build.bat │ │ ├── build.sh │ │ └── build.xml │ │ └── com │ │ └── vgrs │ │ └── xcode │ │ ├── common │ │ ├── Base32.java │ │ ├── Hex.java │ │ ├── Native.java │ │ ├── Unicode.java │ │ ├── UnicodeFilter.java │ │ ├── UnicodeMatrix.java │ │ ├── UnicodeSequence.java │ │ ├── UnicodeTokenizer.java │ │ ├── Utf16.java │ │ ├── Variation.java │ │ ├── package.html │ │ └── test │ │ │ ├── Base32Test.java │ │ │ ├── HexTest.java │ │ │ ├── NativeTest.java │ │ │ └── UnicodeTest.java │ │ ├── ext │ │ ├── Convert.java │ │ ├── DCE.java │ │ ├── EncodingVariants.java │ │ ├── package.html │ │ └── test │ │ │ ├── ConvertTest.java │ │ │ ├── DCETest.java │ │ │ └── EncodingVariantsTest.java │ │ ├── idna │ │ ├── Ace.java │ │ ├── Bidi.java │ │ ├── Charmap.java │ │ ├── Idna.java │ │ ├── Nameprep.java │ │ ├── Normalize.java │ │ ├── Prohibit.java │ │ ├── Punycode.java │ │ ├── Race.java │ │ ├── package.html │ │ └── test │ │ │ ├── BidiTest.java │ │ │ ├── CharmapTest.java │ │ │ ├── IdnaTest.java │ │ │ ├── NameprepTest.java │ │ │ ├── NormalizeTest.java │ │ │ ├── ProhibitTest.java │ │ │ ├── PunycodeTest.java │ │ │ └── RaceTest.java │ │ ├── jnlp │ │ ├── Animation.java │ │ ├── Converter.java │ │ ├── Converter.jnlp │ │ ├── images │ │ │ ├── Cheetah │ │ │ │ ├── Cheetah-1.gif │ │ │ │ ├── Cheetah-2.gif │ │ │ │ ├── Cheetah-3.gif │ │ │ │ ├── Cheetah-4.gif │ │ │ │ ├── Cheetah-5.gif │ │ │ │ ├── Cheetah-6.gif │ │ │ │ ├── Cheetah-7.gif │ │ │ │ └── Cheetah-8.gif │ │ │ ├── VeriSign-Medium.gif │ │ │ └── VeriSign-Small.gif │ │ ├── index.html │ │ └── package.html │ │ └── util │ │ ├── Datafile.java │ │ ├── Debug.java │ │ ├── RandomData.java │ │ ├── XcodeError.java │ │ ├── XcodeErrorGenerator.java │ │ ├── XcodeException.java │ │ └── package.html ├── doc │ ├── Ant - License.txt │ ├── C Readme.txt │ ├── IDNSDK - License.txt │ ├── IDNSDK - Programmer's Guide.pdf │ ├── IDNSDK - Release Notes.txt │ ├── IDNSDK - User's Guide.pdf │ └── javadoc │ │ ├── allclasses-frame.html │ │ ├── com │ │ └── vgrs │ │ │ └── xcode │ │ │ ├── common │ │ │ ├── Base32.html │ │ │ ├── Hex.html │ │ │ ├── Native.html │ │ │ ├── Unicode.html │ │ │ ├── UnicodeFilter.html │ │ │ ├── UnicodeMatrix.html │ │ │ ├── UnicodeSequence.html │ │ │ ├── UnicodeTokenizer.html │ │ │ ├── Utf16.html │ │ │ ├── Variation.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── ext │ │ │ ├── Convert.html │ │ │ ├── DCE.html │ │ │ ├── EncodingVariants.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── idna │ │ │ ├── Ace.html │ │ │ ├── Bidi.html │ │ │ ├── Charmap.html │ │ │ ├── Idna.html │ │ │ ├── Nameprep.html │ │ │ ├── Normalize.html │ │ │ ├── Prohibit.html │ │ │ ├── Punycode.html │ │ │ ├── Race.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── jnlp │ │ │ ├── Animation.html │ │ │ ├── Converter.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ └── util │ │ │ ├── Datafile.html │ │ │ ├── Debug.html │ │ │ ├── RandomData.html │ │ │ ├── XcodeErrorGenerator.html │ │ │ ├── XcodeException.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── deprecated-list.html │ │ ├── help-doc.html │ │ ├── index-all.html │ │ ├── index.html │ │ ├── overview-frame.html │ │ ├── overview-summary.html │ │ ├── overview-tree.html │ │ ├── package-list │ │ ├── packages.html │ │ ├── serialized-form.html │ │ └── stylesheet.css ├── lib │ ├── IDNSDK.jar │ ├── ant-optional.jar │ ├── ant.jar │ ├── jakarta-oro-2.0.7.jar │ ├── win32 │ │ ├── xcode.dll │ │ ├── xcode.lib │ │ └── xcodelib.lib │ └── xerces.jar └── tools │ ├── c │ └── win32 │ │ ├── charmap.exe │ │ ├── domains.exe │ │ ├── fullcircle.exe │ │ ├── headerexport.exe │ │ ├── idna.exe │ │ ├── nameprep.exe │ │ ├── prohibit.exe │ │ ├── punycode.exe │ │ ├── race.exe │ │ ├── unicode.exe │ │ └── utf8.exe │ └── java │ ├── unix │ ├── base32 │ ├── bidi │ ├── charmap │ ├── convert │ ├── dce │ ├── encvariants │ ├── gui │ ├── hex │ ├── idna │ ├── nameprep │ ├── native │ ├── normalize │ ├── prohibit │ ├── punycode │ ├── race │ ├── randomdata │ └── unicode │ └── win32 │ ├── base32.bat │ ├── bidi.bat │ ├── charmap.bat │ ├── convert.bat │ ├── gui.bat │ ├── hex.bat │ ├── idna.bat │ ├── nameprep.bat │ ├── native.bat │ ├── normalize.bat │ ├── prohibit.bat │ ├── punycode.bat │ ├── race.bat │ ├── randomdata.bat │ └── unicode.bat ├── IFUnicodeURL-LICENSE.txt ├── IFUnicodeURL ├── IDNSDK │ ├── adapter.h │ ├── nameprep.c │ ├── nameprep.h │ ├── puny.c │ ├── puny.h │ ├── race.c │ ├── race.h │ ├── staticdata │ │ ├── nameprep_bidi_lcat.h │ │ ├── nameprep_bidi_randalcat.h │ │ ├── nameprep_charmap.h │ │ ├── nameprep_compatible.h │ │ ├── nameprep_compose.h │ │ ├── nameprep_cononical.h │ │ ├── nameprep_data.h │ │ ├── nameprep_datastructures.h │ │ ├── nameprep_decompose.h │ │ ├── nameprep_lookups.h │ │ ├── nameprep_prohibit.h │ │ └── nameprep_prohibit_allowunassigned.h │ ├── toxxx.c │ ├── toxxx.h │ ├── util.c │ ├── util.h │ ├── xcode.h │ └── xcode_config.h ├── NSURL+IFUnicodeURL.h └── NSURL+IFUnicodeURL.m └── README.md /IDNSDK-1.1.0/api/build/Makefile: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # NSI PROPRIETARY AND CONFIDENTIAL # 3 | # # 4 | # This information includes trade secrets and confidential commercial # 5 | # and/or financial information belonging to Network Solutions, Inc. (NSI). # 6 | # It is exempt from disclosure under the Freedom of Information Act. # 7 | # Unauthorized disclosure and/or use of this information without the # 8 | # express written consent of Network Solutions, Inc. is prohibited and # 9 | # may result in criminal prosecution and penalties pursuant to # 10 | # 18 U.S.C. section 1905. # 11 | # # 12 | # COPYRIGHT Network Solutions, Inc. (Unpublished Work) # 13 | ############################################################################ 14 | 15 | # Targets 16 | all: _java _c 17 | java: _java 18 | c: _c 19 | clean: _clean_java _clean_c 20 | fresh: _fresh 21 | 22 | 23 | 24 | # Java 25 | _java: 26 | cd ../java/build; make all 27 | 28 | _clean_java: 29 | cd ../java/build; make clean 30 | 31 | 32 | 33 | # C 34 | _c: 35 | cd ../c/build; make all 36 | 37 | _clean_c: 38 | cd ../c/build; make clean 39 | 40 | 41 | 42 | # Fresh 43 | _fresh: clean 44 | rm -rf ../java/build/logs 45 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/Win32-Projects/test/domains/domains.mak: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Generated NMAKE File, Based on domains.dsp 2 | !IF "$(CFG)" == "" 3 | CFG=domains - Win32 Debug 4 | !MESSAGE No configuration specified. Defaulting to domains - Win32 Debug. 5 | !ENDIF 6 | 7 | !IF "$(CFG)" != "domains - Win32 Release" && "$(CFG)" != "domains - Win32 Debug" 8 | !MESSAGE Invalid configuration "$(CFG)" specified. 9 | !MESSAGE You can specify a configuration when running NMAKE 10 | !MESSAGE by defining the macro CFG on the command line. For example: 11 | !MESSAGE 12 | !MESSAGE NMAKE /f "domains.mak" CFG="domains - Win32 Debug" 13 | !MESSAGE 14 | !MESSAGE Possible choices for configuration are: 15 | !MESSAGE 16 | !MESSAGE "domains - Win32 Release" (based on "Win32 (x86) Console Application") 17 | !MESSAGE "domains - Win32 Debug" (based on "Win32 (x86) Console Application") 18 | !MESSAGE 19 | !ERROR An invalid configuration is specified. 20 | !ENDIF 21 | 22 | !IF "$(OS)" == "Windows_NT" 23 | NULL= 24 | !ELSE 25 | NULL=nul 26 | !ENDIF 27 | 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "domains - Win32 Release" 32 | 33 | OUTDIR=.\Release 34 | INTDIR=.\Release 35 | 36 | ALL : "..\..\..\..\..\tools\c\win32\domains.exe" 37 | 38 | 39 | CLEAN : 40 | -@erase "$(INTDIR)\domains.obj" 41 | -@erase "$(INTDIR)\vc60.idb" 42 | -@erase "..\..\..\..\..\tools\c\win32\domains.exe" 43 | 44 | "$(OUTDIR)" : 45 | if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" 46 | 47 | CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "../../../xcode/inc/" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 48 | BSC32=bscmake.exe 49 | BSC32_FLAGS=/nologo /o"$(OUTDIR)\domains.bsc" 50 | BSC32_SBRS= \ 51 | 52 | LINK32=link.exe 53 | LINK32_FLAGS=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 /incremental:no /pdb:"$(OUTDIR)\domains.pdb" /machine:I386 /out:"../../../../../tools/c/win32/domains.exe" 54 | LINK32_OBJS= \ 55 | "$(INTDIR)\domains.obj" 56 | 57 | "..\..\..\..\..\tools\c\win32\domains.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) 58 | $(LINK32) @<< 59 | $(LINK32_FLAGS) $(LINK32_OBJS) 60 | << 61 | 62 | !ELSEIF "$(CFG)" == "domains - Win32 Debug" 63 | 64 | OUTDIR=.\Debug 65 | INTDIR=.\Debug 66 | 67 | ALL : "..\..\..\..\..\tools\c\win32\domains.exe" 68 | 69 | 70 | CLEAN : 71 | -@erase "$(INTDIR)\domains.obj" 72 | -@erase "$(INTDIR)\vc60.idb" 73 | -@erase "$(INTDIR)\vc60.pdb" 74 | -@erase "$(OUTDIR)\domains.pdb" 75 | -@erase "..\..\..\..\..\tools\c\win32\domains.exe" 76 | -@erase "..\..\..\..\..\tools\c\win32\domains.ilk" 77 | 78 | "$(OUTDIR)" : 79 | if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" 80 | 81 | CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../xcode/inc/" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 82 | BSC32=bscmake.exe 83 | BSC32_FLAGS=/nologo /o"$(OUTDIR)\domains.bsc" 84 | BSC32_SBRS= \ 85 | 86 | LINK32=link.exe 87 | LINK32_FLAGS=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 /incremental:yes /pdb:"$(OUTDIR)\domains.pdb" /debug /machine:I386 /out:"../../../../../tools/c/win32/domains.exe" /pdbtype:sept 88 | LINK32_OBJS= \ 89 | "$(INTDIR)\domains.obj" 90 | 91 | "..\..\..\..\..\tools\c\win32\domains.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) 92 | $(LINK32) @<< 93 | $(LINK32_FLAGS) $(LINK32_OBJS) 94 | << 95 | 96 | !ENDIF 97 | 98 | .c{$(INTDIR)}.obj:: 99 | $(CPP) @<< 100 | $(CPP_PROJ) $< 101 | << 102 | 103 | .cpp{$(INTDIR)}.obj:: 104 | $(CPP) @<< 105 | $(CPP_PROJ) $< 106 | << 107 | 108 | .cxx{$(INTDIR)}.obj:: 109 | $(CPP) @<< 110 | $(CPP_PROJ) $< 111 | << 112 | 113 | .c{$(INTDIR)}.sbr:: 114 | $(CPP) @<< 115 | $(CPP_PROJ) $< 116 | << 117 | 118 | .cpp{$(INTDIR)}.sbr:: 119 | $(CPP) @<< 120 | $(CPP_PROJ) $< 121 | << 122 | 123 | .cxx{$(INTDIR)}.sbr:: 124 | $(CPP) @<< 125 | $(CPP_PROJ) $< 126 | << 127 | 128 | 129 | !IF "$(NO_EXTERNAL_DEPS)" != "1" 130 | !IF EXISTS("domains.dep") 131 | !INCLUDE "domains.dep" 132 | !ELSE 133 | !MESSAGE Warning: cannot find "domains.dep" 134 | !ENDIF 135 | !ENDIF 136 | 137 | 138 | !IF "$(CFG)" == "domains - Win32 Release" || "$(CFG)" == "domains - Win32 Debug" 139 | SOURCE=..\..\..\test\domains\domains.c 140 | 141 | "$(INTDIR)\domains.obj" : $(SOURCE) "$(INTDIR)" 142 | $(CPP) $(CPP_PROJ) $(SOURCE) 143 | 144 | 145 | 146 | !ENDIF 147 | 148 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/Win32-Projects/test/sampleuse/sampleuse.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="sampleuse" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=sampleuse - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "sampleuse.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "sampleuse.mak" CFG="sampleuse - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "sampleuse - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "sampleuse - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "sampleuse - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 | # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../xcode/inc" /I "../../../test/utility" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 46 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 47 | # ADD RSC /l 0x409 /d "NDEBUG" 48 | BSC32=bscmake.exe 49 | # ADD BASE BSC32 /nologo 50 | # ADD BSC32 /nologo 51 | LINK32=link.exe 52 | # 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 /machine:I386 53 | # ADD 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 /machine:I386 54 | 55 | !ELSEIF "$(CFG)" == "sampleuse - Win32 Debug" 56 | 57 | # PROP BASE Use_MFC 0 58 | # PROP BASE Use_Debug_Libraries 1 59 | # PROP BASE Output_Dir "Debug" 60 | # PROP BASE Intermediate_Dir "Debug" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "Debug" 65 | # PROP Intermediate_Dir "Debug" 66 | # PROP Ignore_Export_Lib 0 67 | # PROP Target_Dir "" 68 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 69 | # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../xcode/inc" /I "../../../test/utility" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 70 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 71 | # ADD RSC /l 0x409 /d "_DEBUG" 72 | BSC32=bscmake.exe 73 | # ADD BASE BSC32 /nologo 74 | # ADD BSC32 /nologo 75 | LINK32=link.exe 76 | # 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 77 | # ADD 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 78 | 79 | !ENDIF 80 | 81 | # Begin Target 82 | 83 | # Name "sampleuse - Win32 Release" 84 | # Name "sampleuse - Win32 Debug" 85 | # Begin Group "Source Files" 86 | 87 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 88 | # Begin Source File 89 | 90 | SOURCE=..\..\..\test\sampleuse\examples.c 91 | # End Source File 92 | # End Group 93 | # Begin Group "Header Files" 94 | 95 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 96 | # End Group 97 | # Begin Group "Resource Files" 98 | 99 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 100 | # End Group 101 | # End Target 102 | # End Project 103 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/Win32-Projects/xcodedll/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // racedll.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/Win32-Projects/xcodedll/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__3B2B1E74_9A5B_4707_AB9F_CAC4F7482A0F__INCLUDED_) 7 | #define AFX_STDAFX_H__3B2B1E74_9A5B_4707_AB9F_CAC4F7482A0F__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | 14 | // Insert your headers here 15 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 16 | 17 | #include 18 | 19 | // TODO: reference additional headers your program requires here 20 | 21 | //{{AFX_INSERT_LOCATION}} 22 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 23 | 24 | #endif // !defined(AFX_STDAFX_H__3B2B1E74_9A5B_4707_AB9F_CAC4F7482A0F__INCLUDED_) 25 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/Win32-Projects/xcodedll/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by xcode.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/Win32-Projects/xcodedll/xcode.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/c/Win32-Projects/xcodedll/xcode.aps -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/Win32-Projects/xcodedll/xcode.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/c/Win32-Projects/xcodedll/xcode.rc -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/Win32-Projects/xcodedll/xcodedll.cpp: -------------------------------------------------------------------------------- 1 | // racedll.cpp : Defines the entry point for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "xcode.h" 6 | 7 | BOOL APIENTRY DllMain( HANDLE hModule, 8 | DWORD ul_reason_for_call, 9 | LPVOID lpReserved 10 | ) 11 | { 12 | switch (ul_reason_for_call) 13 | { 14 | case DLL_PROCESS_ATTACH: 15 | case DLL_THREAD_ATTACH: 16 | case DLL_THREAD_DETACH: 17 | case DLL_PROCESS_DETACH: 18 | break; 19 | } 20 | return TRUE; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/build/Makefile: -------------------------------------------------------------------------------- 1 | 2 | UNAME = $(shell uname -s) 3 | PTHREAD = -lpthread 4 | 5 | ifeq ($(UNAME),AIX) 6 | OS = aix 7 | Q32 = -q32 8 | ARCH = -G 9 | endif 10 | ifeq ($(UNAME),SunOS) 11 | OS = solaris 12 | ARCH = -G 13 | endif 14 | ifeq ($(UNAME),Linux) 15 | OS = linux 16 | ARCH = -shared 17 | endif 18 | ifeq ($(UNAME),Darwin) 19 | OS = osx 20 | ARCH = -shared 21 | endif 22 | ifeq ($(UNAME),FreeBSD) 23 | OS = freebsd 24 | ARCH = -shared 25 | PTHREAD = -pthread 26 | endif 27 | 28 | XCODE_INC_PATH = -I../xcode/inc 29 | 30 | CC = gcc 31 | CFLAGS = $(Q32) $(XCODE_INC_PATH) 32 | AFLAGS = $(Q32) $(ARCH) 33 | 34 | CSOURCE = nameprep puny race toxxx util 35 | 36 | LIBRARIES = libxcode 37 | 38 | # Build everything 39 | 40 | all: clean directories $(CSOURCE) $(LIBRARIES) tools 41 | 42 | directories: 43 | @printf "Creating obj and lib directories..." 44 | mkdir -p ../obj/db ../../../lib/$(OS) ../../../tools/c/$(OS) 45 | @printf "done\n" 46 | 47 | # Build the xcodelib library 48 | 49 | $(CSOURCE): 50 | $(CC) -c $(CFLAGS) ../xcode/src/$@.c -o ../obj/$@.o 51 | $(CC) -c $(DEBUG) $(CFLAGS) ../xcode/src/$@.c -o ../obj/db/$@.o 52 | 53 | $(LIBRARIES): 54 | $(CC) $(AFLAGS) -o ../../../lib/$(OS)/$@.so ../obj/*.o $(PTHREAD) 55 | $(CC) $(DEBUG) $(AFLAGS) -o ../../../lib/$(OS)/$@_db.so ../obj/db/*.o $(PTHREAD) 56 | cd ../../../lib/$(OS); ln -fs $@.so $@.a; ln -fs $@_db.so $@_db.a; 57 | 58 | # Build the header export utility based on the current settings in 59 | # xcode_config.h. 60 | 61 | headerexport: 62 | $(CC) $(CFLAGS) $(LDFLAGS) \ 63 | ../xcode/headerexport/headerexport.c ../xcode/headerexport/headergenrfc.c \ 64 | -o ../../../tools/c/$(OS)/headerexport 65 | $(CC) $(DEBUG) $(CFLAGS) $(LDFLAGS) \ 66 | ../xcode/headerexport/headerexport.c ../xcode/headerexport/headergenrfc.c \ 67 | -o ../../../tools/c/$(OS)/headerexportdb 68 | 69 | clean: 70 | rm -rf ../obj ../../../lib/$(OS); cd ../test; make clean 71 | 72 | tools: 73 | cd ../test; make all 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/Makefile: -------------------------------------------------------------------------------- 1 | UNAME = $(shell uname -s) 2 | 3 | ifeq ($(UNAME),AIX) 4 | OS = aix 5 | Q32 = -q32 6 | endif 7 | ifeq ($(UNAME),SunOS) 8 | OS = solaris 9 | XCODE_RUN_PATH = -R../../../../lib/$(OS) 10 | endif 11 | ifeq ($(UNAME),Linux) 12 | OS = linux 13 | XCODE_RUN_PATH = -Wl,-R../../../../lib/$(OS) 14 | endif 15 | ifeq ($(UNAME),Darwin) 16 | OS = osx 17 | endif 18 | ifeq ($(UNAME),FreeBSD) 19 | OS = freebsd 20 | endif 21 | 22 | XCODE_INC_PATH = -I../xcode/inc 23 | XCODE_LIB_PATH = -L../../../lib/$(OS) $(XCODE_RUN_PATH) 24 | XCODE_LIB = -lxcode 25 | 26 | CC = gcc 27 | CFLAGS = $(Q32) $(XCODE_INC_PATH) 28 | LDFLAGS = $(XCODE_LIB_PATH) 29 | 30 | all: _punycode _race _charmap _prohibit _idna _unicode _domains _utf8 31 | 32 | clean: 33 | rm -rf ../../../tools/c/$(OS) 34 | 35 | _punycode: 36 | $(CC) $(CFLAGS) $(LDFLAGS) $(XCODE_LIB) punycode/punycode.c -o ../../../tools/c/$(OS)/punycode 37 | 38 | _race: 39 | $(CC) $(CFLAGS) $(LDFLAGS) $(XCODE_LIB) race/race.c -o ../../../tools/c/$(OS)/race 40 | 41 | _charmap: 42 | $(CC) $(CFLAGS) $(LDFLAGS) $(XCODE_LIB) charmap/charmap.c -o ../../../tools/c/$(OS)/charmap 43 | 44 | _prohibit: 45 | $(CC) $(CFLAGS) $(LDFLAGS) $(XCODE_LIB) prohibit/prohibit.c -o ../../../tools/c/$(OS)/prohibit 46 | 47 | _idna: 48 | $(CC) $(CFLAGS) $(LDFLAGS) $(XCODE_LIB) idna/idna.c -o ../../../tools/c/$(OS)/idna 49 | 50 | _unicode: 51 | $(CC) $(CFLAGS) $(LDFLAGS) $(XCODE_LIB) unicode/unicode.c -o ../../../tools/c/$(OS)/unicode 52 | 53 | _domains: 54 | $(CC) $(CFLAGS) $(LDFLAGS) $(XCODE_LIB) domains/domains.c -o ../../../tools/c/$(OS)/domains 55 | 56 | _utf8: 57 | $(CC) $(CFLAGS) $(LDFLAGS) $(XCODE_LIB) utf8/utf8.c -o ../../../tools/c/$(OS)/utf8 58 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/charmap/charmap.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * Charmap * 4 | ********************************************************************************/ 5 | 6 | /* 7 | Purpose: This tool is the first component of Nameprep. It converts a single codepoint in the 8 | input sequence, into zero or more codepoints in the output sequence. 9 | 10 | Usage charmap 11 | 12 | Input type: Unicode 13 | Output type: Unicode 14 | */ 15 | 16 | #include "xcode.h" 17 | #include "../utility/utility.h" 18 | #include 19 | 20 | #ifdef WIN32 21 | #ifdef _DEBUG 22 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 23 | #else 24 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 25 | #endif 26 | #endif 27 | 28 | #include 29 | #include "../../xcode/inc/staticdata/nameprep_datastructures.h" 30 | #include "../../xcode/inc/staticdata/nameprep_charmap.h" 31 | #include "../../xcode/inc/staticdata/nameprep_prohibit.h" 32 | 33 | void buildCharmapInput() 34 | { 35 | int i, j, index, ccount; 36 | FILE * fp = fopen( "../../../testdata/charmap.input.txt", "w" ); 37 | 38 | for ( i = 0; i <= 5000; i++ ) 39 | { 40 | ccount = (int)rand(); 41 | ccount = (int)(((float)rand() / (float)RAND_MAX) * 15.0f); 42 | if ( ccount == 0 ) ccount = 1; 43 | 44 | for ( j = 0; j < ccount; j++ ) 45 | { 46 | index = (int)(((float)rand() / (float)RAND_MAX) * CHARMAP_ENTRYCOUNT); 47 | if ( j > 0 ) fprintf( fp, " " ); 48 | fprintf( fp, "%x", g_charmapTable[index].dwCodepoint ); 49 | } 50 | fprintf( fp, "\n" ); 51 | } 52 | fcloseall(); 53 | } 54 | 55 | int main(int argc, char* argv[]) 56 | { 57 | FILE * fpin; 58 | /* FILE * fpout; */ 59 | char szIn[1024]; 60 | DWORD dwInput[1024]; 61 | DWORD dwOutput[1024]; 62 | int iInputSize = 0; 63 | int iOutputSize = 0; 64 | int counter = 0; 65 | int res; 66 | int i; 67 | 68 | /* buildCharmapInput(); */ 69 | 70 | /* fpout = fopen( "../../../testdata/charmap.output.txt", "w" ); */ 71 | 72 | /* Arg check */ 73 | if (argc < 2) { printf("usage: \n", argv[0] ); return 1; } 74 | 75 | /* Get file */ 76 | fpin = fopen(argv[1], "r"); 77 | if (fpin == NULL) { printf("Cannot open %s\n",argv[1]); return 1; } 78 | 79 | while ( !feof( fpin ) ) 80 | { 81 | memset( szIn, 0, sizeof(szIn) ); 82 | memset( dwInput, 0, sizeof(dwInput) ); 83 | memset( dwOutput, 0, sizeof(dwOutput) ); 84 | 85 | fgets( szIn, sizeof(szIn), fpin ); 86 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) 87 | { 88 | printf( szIn ); 89 | continue; 90 | } 91 | 92 | Read32BitLine( szIn, dwInput, &iInputSize ); 93 | 94 | iOutputSize = 1024; 95 | res = Xcode_charmapString( dwInput, iInputSize, dwOutput, &iOutputSize ); 96 | 97 | counter++; 98 | 99 | if ( res != XCODE_SUCCESS ) 100 | { 101 | char szMsg[1024]; 102 | ConvertErrorCode( res, szMsg ); 103 | printf( "Error: Line=%d '%25s' (%s)\n", counter, szMsg, szIn ); 104 | continue; 105 | } 106 | 107 | for( i = 0; i < iOutputSize; i++ ) 108 | { 109 | if ( i > 0 ) printf( " " ); 110 | printf( "%x", dwOutput[i] ); 111 | } 112 | printf( "\n" ); 113 | 114 | } 115 | 116 | fclose(fpin); 117 | #ifdef WIN32 118 | getchar(); 119 | #endif 120 | return 0; 121 | 122 | } 123 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/domains/domains.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* sampleuse */ 4 | /* */ 5 | /* Simple examples of library use used in the HowTo.txt document. */ 6 | /* */ 7 | /* (c) Verisign Inc., 2000-2002, All rights reserved */ 8 | /* */ 9 | /*************************************************************************/ 10 | 11 | #include "xcode.h" 12 | #include 13 | #include "../utility/utility.h" 14 | 15 | #ifdef WIN32 16 | #ifdef _DEBUG 17 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 18 | #else 19 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 20 | #endif 21 | #endif 22 | 23 | int main(int argc, char* argv[]) 24 | { 25 | FILE * fpin; 26 | char szIn[1024]; 27 | char szOut[1024]; 28 | UCHAR8 szData[MAX_DOMAIN_SIZE_8]; 29 | UTF16CHAR uInput[MAX_DOMAIN_SIZE_16]; 30 | int iInputSize = 0; 31 | int iOutputSize = 0; 32 | int counter = 0; 33 | int res; 34 | 35 | /* Arg check */ 36 | if (argc < 1) { printf("usage: [toascii,tounicode] \n", argv[0] ); return 1; } 37 | 38 | /* Get file */ 39 | fpin = fopen(argv[1], "r"); 40 | if (fpin == NULL) { printf("Cannot open %s\n",argv[1]); return 1; } 41 | 42 | while ( !feof( fpin ) ) 43 | { 44 | memset( szIn, 0, sizeof(szIn) ); 45 | memset( szOut, 0, sizeof(szOut) ); 46 | memset( szData, 0, sizeof(szData) ); 47 | 48 | fgets( szIn, sizeof(szIn), fpin ); 49 | counter++; 50 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) continue; 51 | fgets( szOut, sizeof(szOut), fpin ); 52 | counter++; 53 | 54 | /* Clip off \n */ 55 | szIn[strlen(szIn)-1] = 0; 56 | szOut[strlen(szOut)-1] = 0; 57 | 58 | if ( szIn[0] != 'i' ) { printf("Invalid input file format.\n"); return 1; } 59 | if ( szOut[0] != 'o' ) { printf("Invalid input file format.\n"); return 1; } 60 | 61 | Read16BitLine( &szIn[2], uInput, &iInputSize ); 62 | iOutputSize = sizeof(szData); 63 | res = Xcode_DomainToASCII( uInput, iInputSize, szData, &iOutputSize ); 64 | 65 | counter++; 66 | 67 | if ( res != XCODE_SUCCESS ) 68 | { 69 | char szMsg[1024]; 70 | ConvertErrorCode( res, szMsg ); 71 | printf( "Error: line %d Code %s (%s)\n", counter, szMsg, &szIn[2] ); 72 | continue; 73 | } 74 | 75 | printf( "%s\n", szData ); 76 | } 77 | 78 | fclose(fpin); 79 | #ifdef WIN32 80 | getchar(); 81 | #endif 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/fullcircle/fullcircle.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * Fullcircle * 4 | ********************************************************************************/ 5 | 6 | /* 7 | Purpose: C specific test harness. 8 | 9 | Usage fullcircle 10 | */ 11 | 12 | #include "xcode.h" 13 | #include "../utility/utility.h" 14 | #include 15 | 16 | #ifdef WIN32 17 | #ifdef _DEBUG 18 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 19 | #else 20 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 21 | #endif 22 | #endif 23 | 24 | int main(int argc, char* argv[]) 25 | { 26 | FILE * fpin; 27 | char szIn[1024]; 28 | char szOut[1024]; 29 | DWORD dwInput[1024]; 30 | DWORD dwOutput[1024]; 31 | UCHAR8 szData[1024]; 32 | UTF16CHAR uInput[1024]; 33 | int iInputSize = 0; 34 | int iOutputSize = 0; 35 | int counter = 0; 36 | int res; 37 | 38 | /* Arg check */ 39 | if (argc < 2) { printf("usage: \n", argv[0] ); return 1; } 40 | 41 | /* Get file */ 42 | fpin = fopen(argv[1], "r"); 43 | if (fpin == NULL) { printf("Cannot open %s\n",argv[1]); return 1; } 44 | 45 | while ( !feof( fpin ) ) 46 | { 47 | memset( szIn, 0, sizeof(szIn) ); 48 | memset( szOut, 0, sizeof(szOut) ); 49 | memset( dwInput, 0, sizeof(dwInput) ); 50 | memset( dwOutput, 0, sizeof(dwOutput) ); 51 | memset( szData, 0, sizeof(szData) ); 52 | 53 | 54 | fgets( szIn, sizeof(szIn), fpin ); 55 | counter++; 56 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) 57 | { 58 | printf( szIn ); 59 | continue; 60 | } 61 | fgets( szOut, sizeof(szOut), fpin ); 62 | counter++; 63 | 64 | /* Clip off \n */ 65 | szIn[strlen(szIn)-1] = 0; 66 | szOut[strlen(szOut)-1] = 0; 67 | 68 | if ( szIn[0] != 'i' ) { printf("Invalid input file format.\n"); return 1; } 69 | if ( szOut[0] != 'o' ) { printf("Invalid input file format.\n"); return 1; } 70 | 71 | if ( szOut[strlen(szOut)-1] == ' ' ) szOut[strlen(szOut)-1] = '\0'; 72 | 73 | /* 74 | Read32BitLine( &szIn[2], dwInput, &iInputSize ); 75 | iOutputSize = sizeof(dwOutput); 76 | res = Xcode_nameprepString32( dwInput, iInputSize, dwOutput, &iOutputSize, &dwProhibitChar ); 77 | if ( res != XCODE_SUCCESS ) goto error; 78 | iInputSize = sizeof(szData); 79 | res = Xcode_puny_encodeString( dwOutput, iOutputSize, szData, &iInputSize ); 80 | */ 81 | 82 | iInputSize = sizeof( dwInput ); 83 | Read32BitLine( &szIn[2], dwInput, &iInputSize ); 84 | 85 | iOutputSize = sizeof(uInput); 86 | res = Xcode_convert32BitToUTF16( dwInput, iInputSize, uInput, &iOutputSize ); 87 | 88 | iInputSize = iOutputSize; 89 | 90 | iOutputSize = sizeof(szData); 91 | res = Xcode_ToASCII( uInput, iInputSize, szData, &iOutputSize ); 92 | 93 | if ( res != XCODE_SUCCESS ) 94 | { 95 | char szMsg[1024]; 96 | ConvertErrorCode( res, szMsg ); 97 | printf( "Fail: Line=%d '%25s' (%s)(%s)\n", counter, szMsg, szIn, szOut ); 98 | continue; 99 | } 100 | 101 | if ( stricmp( &szOut[2], szData ) != 0 ) 102 | { 103 | //printf( "%s\no:%s\n", szIn, szData ); 104 | printf( "Error : Line=%d '%s' != '%s'\n", counter, &szOut[2], szData ); 105 | continue; 106 | } 107 | 108 | printf( "Success: Line=%d '%s'\n", counter, &szOut[2] ); 109 | //printf( "%s\no:%s\n", szIn, szData ); 110 | } 111 | 112 | fclose(fpin); 113 | #ifdef WIN32 114 | getchar(); 115 | #endif 116 | return 0; 117 | } 118 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/idna/idna.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * IDNA * 4 | ********************************************************************************/ 5 | 6 | /* 7 | Purpose: Internationalized Domain Names in Applications. A set of algorithms, 8 | which define a way to encode and decode Unicode data making it compatible 9 | with the Domain Naming System. 10 | 11 | Usage: idna (toAscii|toUnicode) 12 | 13 | Input type: Unicode for toAscii, ASCII for toUnicode 14 | Output type: ASCII for toAscii, Unicode for toUnicode 15 | */ 16 | 17 | #include "xcode.h" 18 | #include "../utility/utility.h" 19 | #include 20 | 21 | #ifdef WIN32 22 | #ifdef _DEBUG 23 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 24 | #else 25 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 26 | #endif 27 | #endif 28 | 29 | void setupTestcase() 30 | { 31 | FILE * fp; 32 | int i; 33 | fp = fopen( "test.txt", "w" ); 34 | //fprintf( fp, "xn--rvjze3zks5ga." ); 35 | for ( i = 1; i <= 0xff; i++ ) fprintf( fp, "%c", i ); 36 | } 37 | 38 | int main(int argc, char* argv[]) 39 | { 40 | FILE * fpin; 41 | char szIn[1024]; 42 | DWORD dwInput[1024]; 43 | UTF16CHAR uInput[MAX_DOMAIN_SIZE_16]; 44 | UTF16CHAR uOutput[MAX_DOMAIN_SIZE_16]; 45 | UCHAR8 szOutput[MAX_DOMAIN_SIZE_8]; 46 | int iInputSize = 0; 47 | int iOutputSize = 0; 48 | int iOutputSize2 = 0; 49 | int counter = 0; 50 | int res; 51 | int i; 52 | int toascii = 0; 53 | int inputis8bit = 0; 54 | 55 | //setupTestcase(); 56 | //return 0; 57 | 58 | /* Arg check */ 59 | if (argc < 2) { 60 | printf("usage: (toAscii | toUnicode) \n", argv[0] ); 61 | return 1; 62 | } 63 | 64 | if ( strcmp( "toAscii", argv[1] ) == 0 ) {toascii = 1;} 65 | fpin = fopen(argv[2], "r"); 66 | if (fpin == NULL) { printf("Cannot open %s\n",argv[2]); return 1; } 67 | 68 | while ( !feof( fpin ) ) { 69 | memset( szIn, 0, sizeof(szIn) ); 70 | memset( uInput, 0, sizeof(uInput) ); 71 | memset( szOutput, 0, sizeof(szOutput) ); 72 | 73 | fgets( szIn, sizeof(szIn), fpin ); 74 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) { 75 | printf( szIn ); 76 | continue; 77 | } 78 | 79 | if ( toascii ) { 80 | Read32BitLine( szIn, dwInput, &iInputSize ); 81 | 82 | iOutputSize = MAX_DOMAIN_SIZE_16; 83 | res = Xcode_convert32BitToUTF16( dwInput, iInputSize, uInput, &iOutputSize ); 84 | 85 | if ( res != XCODE_SUCCESS ) { 86 | char szMsg[1024]; 87 | ConvertErrorCode( res, szMsg ); 88 | printf( "Error: Line=%d '%25s' (%s)\n", counter, szMsg, szIn ); 89 | continue; 90 | } 91 | 92 | iInputSize = iOutputSize; 93 | iOutputSize = sizeof(szOutput); 94 | res = Xcode_DomainToASCII( uInput, iInputSize, szOutput, &iOutputSize ); 95 | 96 | } else { 97 | 98 | iOutputSize = MAX_DOMAIN_SIZE_16; 99 | szIn[strlen(szIn)-1] = 0; 100 | res = Xcode_DomainToUnicode8( szIn, strlen(szIn), uInput, &iOutputSize ); 101 | 102 | /* 103 | // This was the code for handling Unicode input in the toUnicode() method 104 | Read32BitLine( szIn, dwInput, &iInputSize ); 105 | 106 | iOutputSize2 = MAX_DOMAIN_SIZE_16; 107 | res = Xcode_convert32BitToUTF16(dwInput, iInputSize, uOutput, &iOutputSize2 ); 108 | if ( res != XCODE_SUCCESS ) { 109 | char szMsg[1024]; 110 | ConvertErrorCode( res, szMsg ); 111 | printf( "Error: Line=%d '%25s' (%s)\n", counter, szMsg, szIn ); 112 | continue; 113 | } 114 | 115 | iOutputSize = MAX_DOMAIN_SIZE_16; 116 | res = Xcode_DomainToUnicode16( uOutput, iOutputSize2, uInput, &iOutputSize ); 117 | */ 118 | } 119 | 120 | counter++; 121 | 122 | if ( res != XCODE_SUCCESS ) { 123 | char szMsg[1024]; 124 | ConvertErrorCode( res, szMsg ); 125 | printf( "Error: Line=%d %s\n", counter, szMsg ); 126 | continue; 127 | } 128 | if ( toascii ) { 129 | printf( "%s\n", szOutput ); 130 | } else { 131 | for( i = 0; i < iOutputSize; i++ ) { 132 | if ( i > 0 ) printf( " " ); 133 | printf( "%x", uInput[i] ); 134 | } 135 | printf( "\n" ); 136 | } 137 | } 138 | 139 | fclose(fpin); 140 | #ifdef WIN32 141 | getchar(); 142 | #endif 143 | return 0; 144 | 145 | } 146 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/nameprep/nameprep.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * Nameprep * 4 | ********************************************************************************/ 5 | 6 | /* 7 | Purpose Domain Name Preparation. An algorithm designed to normalize Unicode data forcing like 8 | sequences to have equivalent data representation. This tool runs the Charmap, Normalize, 9 | Prohibit, and Bidi algorithms in that order. 10 | 11 | Usage nameprep [-a] 12 | -a => Allow unassigned codepoints (disallowed by default) 13 | 14 | Input type Unicode 15 | Output type Unicode 16 | */ 17 | 18 | #include "xcode.h" 19 | #include "../utility/utility.h" 20 | #include 21 | 22 | #ifdef WIN32 23 | #ifdef _DEBUG 24 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 25 | #else 26 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 27 | #endif 28 | #endif 29 | 30 | 31 | int main(int argc, char* argv[]) 32 | { 33 | FILE * fpin; 34 | char szIn[1024]; 35 | DWORD dwInput[1024]; 36 | DWORD dwOutput[1024]; 37 | DWORD dwProhibitChar; 38 | int iInputSize = 0; 39 | int iOutputSize = 0; 40 | int counter = 0; 41 | int res; 42 | int i; 43 | 44 | /* Arg check */ 45 | if (argc < 2) { printf("usage: \n", argv[0] ); return 1; } 46 | 47 | /* Get file */ 48 | fpin = fopen(argv[1], "r"); 49 | if (fpin == NULL) { printf("Cannot open %s\n",argv[1]); return 1; } 50 | 51 | while ( !feof( fpin ) ) 52 | { 53 | memset( szIn, 0, sizeof(szIn) ); 54 | memset( dwInput, 0, sizeof(dwInput) ); 55 | memset( dwOutput, 0, sizeof(dwOutput) ); 56 | 57 | fgets( szIn, sizeof(szIn), fpin ); 58 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) 59 | { 60 | printf( szIn ); 61 | continue; 62 | } 63 | 64 | /* Clip off \n */ 65 | szIn[strlen(szIn)-1] = 0; 66 | 67 | Read32BitLine( szIn, dwInput, &iInputSize ); 68 | 69 | iOutputSize = 1024; 70 | res = Xcode_nameprepString32( dwInput, iInputSize, dwOutput, &iOutputSize, &dwProhibitChar ); 71 | 72 | counter++; 73 | 74 | if ( res != XCODE_SUCCESS ) 75 | { 76 | char szMsg[1024]; 77 | ConvertErrorCode( res, szMsg ); 78 | printf( "Fail: Line=%d '%25s' (%s)\n", counter, szMsg, szIn ); 79 | continue; 80 | } 81 | 82 | for( i = 0; i < iOutputSize; i++ ) 83 | { 84 | printf( "%05X ", dwOutput[i] ); 85 | } 86 | printf( "\n" ); 87 | 88 | } 89 | 90 | fclose(fpin); 91 | #ifdef WIN32 92 | getchar(); 93 | #endif 94 | return 0; 95 | 96 | } 97 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/prohibit/prohibit.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * Prohibit * 4 | ********************************************************************************/ 5 | 6 | /* 7 | Purpose: This algorithm is the third component of Nameprep. It prohibits certain 8 | codepoints from appearing in an IDN input sequence. 9 | 10 | Usage: prohibit [-a] 11 | -a => Allow unassigned codepoints (disallowed by default) 12 | 13 | Input type: Unicode 14 | Output type: Error condition if prohibited codepoints are found. 15 | */ 16 | 17 | #include "xcode.h" 18 | #include "../utility/utility.h" 19 | #include 20 | 21 | #ifdef WIN32 22 | #ifdef _DEBUG 23 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 24 | #else 25 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 26 | #endif 27 | #endif 28 | 29 | #include 30 | #include "../../xcode/inc/staticdata/nameprep_datastructures.h" 31 | #include "../../xcode/inc/staticdata/nameprep_charmap.h" 32 | #include "../../xcode/inc/staticdata/nameprep_prohibit.h" 33 | 34 | void buildProhibitInput() 35 | { 36 | int i, j, index, count; 37 | FILE * fp = fopen( "../../../testdata/prohibit.input.txt", "w" ); 38 | 39 | for ( i = 0; i <= 1000; i++ ) 40 | { 41 | index = (int)(((float)rand() / (float)RAND_MAX) * PROHIBIT_ENTRYCOUNT); 42 | count = 0; 43 | for ( j = g_prohibitTable[index].low; j <= g_prohibitTable[index].high; j++ ) 44 | { 45 | count++; 46 | fprintf( fp, "%x\n", j ); 47 | if ( count > 5 ) break; 48 | } 49 | } 50 | fcloseall(); 51 | } 52 | 53 | int main(int argc, char* argv[]) 54 | { 55 | FILE * fpin; 56 | /* FILE * fpout; */ 57 | char szIn[1024]; 58 | DWORD dwInput[1024]; 59 | DWORD dwProhibitChar; 60 | int iInputSize = 0; 61 | int counter = 0; 62 | int res; 63 | int i; 64 | 65 | /* buildProhibitInput(); */ 66 | 67 | /* fpout = fopen( "../../../testdata/prohibit.output.txt", "w" ); */ 68 | 69 | /* Arg check */ 70 | if (argc < 2) { printf("usage: \n", argv[0] ); return 1; } 71 | 72 | /* Get file */ 73 | fpin = fopen(argv[1], "r"); 74 | if (fpin == NULL) { printf("Cannot open %s\n",argv[1]); return 1; } 75 | 76 | while ( !feof( fpin ) ) 77 | { 78 | memset( szIn, 0, sizeof(szIn) ); 79 | memset( dwInput, 0, sizeof(dwInput) ); 80 | 81 | fgets( szIn, sizeof(szIn), fpin ); 82 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) 83 | { 84 | printf( szIn ); 85 | continue; 86 | } 87 | 88 | /* Clip off \n */ 89 | szIn[strlen(szIn)-1] = 0; 90 | 91 | Read32BitLine( szIn, dwInput, &iInputSize ); 92 | 93 | res = Xcode_prohibitString( dwInput, iInputSize, &dwProhibitChar ); 94 | 95 | counter++; 96 | 97 | if ( res != XCODE_SUCCESS ) 98 | { 99 | char szMsg[1024]; 100 | ConvertErrorCode( res, szMsg ); 101 | printf( "Error: Line=%d '%25s' Char=%05X (%s)\n", counter, szMsg, dwProhibitChar, szIn ); 102 | continue; 103 | } 104 | 105 | for( i = 0; i < iInputSize; i++ ) 106 | { 107 | if ( i > 0 ) printf( " " ); 108 | printf( "%x", dwInput[i] ); 109 | } 110 | printf( "\n" ); 111 | } 112 | 113 | fclose(fpin); 114 | #ifdef WIN32 115 | getchar(); 116 | #endif 117 | return 0; 118 | 119 | } 120 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/punycode/punycode.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * Punycode * 4 | ********************************************************************************/ 5 | 6 | /* 7 | Purpose: This tool compresses and converts Unicode data into an ASCII compatible sequence. 8 | This algorithm was designed for use with IDNA. No other ACE encoding is supported 9 | by the IETF. The IDNA draft gives applications permission to choose whether or not 10 | to exclude ASCII characters which are not a letter, digit, or hyphen. If the -3 switch 11 | is given, these codepoints are allowed to be encoded by Punycode. 12 | 13 | Usage: punycode [-3] (encode|decode) 14 | -3 => do NOT enforce Std 3 ASCII rules 15 | 16 | Input type: Unicode 17 | Output type: ASCII 18 | */ 19 | 20 | #include "xcode.h" 21 | #include "../utility/utility.h" 22 | #include 23 | 24 | #ifdef WIN32 25 | #ifdef _DEBUG 26 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 27 | #else 28 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 29 | #endif 30 | #endif 31 | 32 | int main(int argc, char* argv[]) 33 | { 34 | FILE * fpin; 35 | char szIn[1024]; 36 | DWORD dwInput[1024]; 37 | DWORD dwOutput[1024]; 38 | UCHAR8 szData[1024]; 39 | UTF16CHAR uData[1024]; 40 | int iInputSize = 0; 41 | int iOutputSize = 0; 42 | int counter = 0; 43 | int res; 44 | int i; 45 | int encode = 0; 46 | 47 | /* Arg check */ 48 | if (argc < 2) { printf("usage: [encode (to puny)|decode (to unicode)] \n", argv[0] ); return 1; } 49 | 50 | /* Get file */ 51 | fpin = fopen(argv[2], "r"); 52 | if (fpin == NULL) { printf("Cannot open %s\n",argv[2]); return 1; } 53 | 54 | if ( strcmp( argv[1], "encode" ) == 0 ) encode = 1; 55 | 56 | while ( !feof( fpin ) ) 57 | { 58 | memset( szIn, 0, sizeof(szIn) ); 59 | memset( dwInput, 0, sizeof(dwInput) ); 60 | memset( dwOutput, 0, sizeof(dwOutput) ); 61 | memset( uData, 0, sizeof(uData) ); 62 | memset( szData, 0, sizeof(szData) ); 63 | 64 | fgets( szIn, sizeof(szIn), fpin ); 65 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) 66 | { 67 | printf( szIn ); 68 | continue; 69 | } 70 | 71 | /* Clip off \n */ 72 | szIn[strlen(szIn)-1] = 0; 73 | 74 | if ( encode ) 75 | Read32BitLine( szIn, dwInput, &iInputSize ); 76 | 77 | iOutputSize = 1024; 78 | 79 | if ( encode ) 80 | { 81 | res = Xcode_puny_encodeString( dwInput, iInputSize, szData, &iOutputSize ); 82 | } else { 83 | iInputSize = strlen( szIn ); 84 | res = Xcode_puny_decodeString( szIn, iInputSize, uData, &iOutputSize ); 85 | if ( res != XCODE_SUCCESS ) goto error; 86 | res = Xcode_convertUTF16To32Bit( uData, iOutputSize, dwOutput, &iOutputSize ); 87 | } 88 | 89 | counter++; 90 | 91 | error: 92 | if ( res != XCODE_SUCCESS ) 93 | { 94 | char szMsg[1024]; 95 | ConvertErrorCode( res, szMsg ); 96 | printf( "Fail: Line=%d '%25s' (%s)\n", counter, szMsg, szIn ); 97 | continue; 98 | } 99 | 100 | for( i = 0; i < iOutputSize; i++ ) 101 | { 102 | if ( encode ) 103 | printf( "%c", szData[i] ); 104 | else 105 | printf( "%x ", dwOutput[i] ); 106 | } 107 | printf( "\n" ); 108 | 109 | } 110 | 111 | fclose(fpin); 112 | #ifdef WIN32 113 | getchar(); 114 | #endif 115 | return 0; 116 | 117 | } 118 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/race/race.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * Race * 4 | ******************************************************************************/ 5 | 6 | /* 7 | * Purpose: 8 | * This tool compresses and converts Unicode data into an ASCII compatible 9 | * sequence. This particular algorithm is no longer supported by the IETF. 10 | * The IDNA draft gives applications permission to choose whether or not to 11 | * exclude ASCII characters which are not a letter, digit, or hyphen. If 12 | * the -3 switch is given then these no standard codepoints are allowed. 13 | * 14 | * Usage: race [-3] (encode|decode) 15 | * -3 => do NOT enforce Std 3 ASCII rules 16 | * 17 | * Input type: Utf-16 18 | * Output type: ASCII 19 | */ 20 | 21 | #include "xcode.h" 22 | #include "../utility/utility.h" 23 | #include 24 | 25 | #ifdef WIN32 26 | #ifdef _DEBUG 27 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 28 | #else 29 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 30 | #endif 31 | #endif 32 | 33 | int main(int argc, char* argv[]) 34 | { 35 | FILE * fpin; 36 | char szIn[1024]; 37 | UTF16CHAR uInput[1024]; 38 | DWORD dwOutput[1024]; 39 | UCHAR8 szData[1024]; 40 | UTF16CHAR uData[1024]; 41 | int iInputSize = 0; 42 | int iOutputSize = 0; 43 | int counter = 0; 44 | int res; 45 | int i; 46 | int encode = 0; 47 | 48 | /* Arg check */ 49 | if (argc < 2) { printf("usage: [encode (to race)|decode (to unicode)] \n", argv[0] ); return 1; } 50 | 51 | /* Get file */ 52 | fpin = fopen(argv[2], "r"); 53 | if (fpin == NULL) { printf("Cannot open %s\n",argv[2]); return 1; } 54 | 55 | if ( strcmp( argv[1], "encode" ) == 0 ) encode = 1; 56 | 57 | while ( !feof( fpin ) ) 58 | { 59 | memset( szIn, 0, sizeof(szIn) ); 60 | memset( uInput, 0, sizeof(uInput) ); 61 | memset( dwOutput, 0, sizeof(dwOutput) ); 62 | memset( uData, 0, sizeof(uData) ); 63 | memset( szData, 0, sizeof(szData) ); 64 | 65 | fgets( szIn, sizeof(szIn), fpin ); 66 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) 67 | { 68 | printf( szIn ); 69 | continue; 70 | } 71 | 72 | /* Clip off \n */ 73 | szIn[strlen(szIn)-1] = 0; 74 | 75 | if ( encode ) 76 | Read16BitLine( szIn, uInput, &iInputSize ); 77 | 78 | iOutputSize = 1024; 79 | 80 | if ( encode ) 81 | { 82 | res = Xcode_race_encodeString( uInput, iInputSize, szData, &iOutputSize, "bq--", 4 ); 83 | } else { 84 | iInputSize = strlen( szIn ); 85 | res = Xcode_race_decodeString( szIn, iInputSize, uData, &iOutputSize, "bq--", 4 ); 86 | if ( res != XCODE_SUCCESS ) goto error; 87 | res = Xcode_convertUTF16To32Bit( uData, iOutputSize, dwOutput, &iOutputSize ); 88 | } 89 | 90 | counter++; 91 | 92 | error: 93 | if ( res != XCODE_SUCCESS ) 94 | { 95 | char szMsg[1024]; 96 | ConvertErrorCode( res, szMsg ); 97 | printf( "Fail: Line=%d '%25s' (%s)\n", counter, szMsg, szIn ); 98 | continue; 99 | } 100 | 101 | for( i = 0; i < iOutputSize; i++ ) 102 | { 103 | if ( encode ) 104 | printf( "%c", szData[i] ); 105 | else 106 | printf( "%x ", dwOutput[i] ); 107 | } 108 | printf( "\n" ); 109 | 110 | } 111 | 112 | fclose(fpin); 113 | #ifdef WIN32 114 | getchar(); 115 | #endif 116 | return 0; 117 | 118 | } 119 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/sampleuse/examples.c: -------------------------------------------------------------------------------- 1 | 2 | #include "xcode.h" 3 | 4 | void testCharactermap( void ) 5 | { 6 | int res; 7 | DWORD dwOutput[1024]; 8 | DWORD dwInput[] = { 0x1d56f, 0x1e22, 0x3a5 }; 9 | 10 | int iInputSize = 3; 11 | int iOutputSize = sizeof(dwOutput); 12 | 13 | res = Xcode_charmapString( dwInput, iInputSize, dwOutput, &iOutputSize ); 14 | 15 | if ( res != XCODE_SUCCESS ) 16 | { 17 | /* Error */ 18 | } 19 | } 20 | 21 | void testProhibit( void ) 22 | { 23 | int res; 24 | DWORD dwInput[] = { 0x1d56f, 0x1e22, 0x3a5 }; 25 | DWORD dwProhibitChar; 26 | 27 | int iInputSize = 3; 28 | 29 | res = Xcode_prohibitString( dwInput, iInputSize, &dwProhibitChar ); 30 | 31 | if ( res != XCODE_SUCCESS ) 32 | { 33 | /* Error */ 34 | } 35 | } 36 | 37 | void testNormalize( void ) 38 | { 39 | int res; 40 | DWORD dwOutput[1024]; 41 | DWORD dwInput[] = { 0x1d56f, 0x1e22, 0x3a5 }; 42 | 43 | int iInputSize = 3; 44 | int iOutputSize = sizeof(dwOutput); 45 | 46 | res = Xcode_normalizeString( dwInput, iInputSize, dwOutput, &iOutputSize ); 47 | 48 | if ( res != XCODE_SUCCESS ) 49 | { 50 | /* Error */ 51 | } 52 | } 53 | 54 | void testNameprep( void ) 55 | { 56 | int res; 57 | DWORD dwOutput[1024]; 58 | UTF16CHAR uInput[] = { 0xda00, 0xdc1c, 0xda00, 0xdc1d }; 59 | DWORD dwProhibitChar; 60 | 61 | int iInputSize = 4; 62 | int iOutputSize = sizeof(dwOutput); 63 | 64 | res = Xcode_nameprepString( uInput, iInputSize, dwOutput, &iOutputSize, &dwProhibitChar ); 65 | 66 | if ( res != XCODE_SUCCESS ) 67 | { 68 | /* Error */ 69 | } 70 | } 71 | 72 | void testBidiFilter( void ) 73 | { 74 | int res; 75 | DWORD dwInput[] = { 0x1d56f, 0x1e22, 0x3a5 }; 76 | 77 | int iInputSize = 3; 78 | 79 | res = Xcode_bidifilterString( dwInput, iInputSize ); 80 | 81 | if ( res != XCODE_SUCCESS ) 82 | { 83 | /* Error */ 84 | } 85 | } 86 | 87 | void testUTFConvert() 88 | { 89 | int i; 90 | DWORD dwInput[5]; 91 | UTF16CHAR uResult[256]; 92 | DWORD dwResult[10]; 93 | int iuResultLength = sizeof(uResult); 94 | int idwResultLength = sizeof(dwResult); 95 | 96 | for ( i = 0x90000; i <= 0x10FFFF; i = i + 4 ) 97 | { 98 | dwInput[0] = i; 99 | dwInput[1] = i+1; 100 | dwInput[2] = i+2; 101 | dwInput[3] = i+3; 102 | 103 | Xcode_convert32BitToUTF16( dwInput, 4, uResult, &iuResultLength ); 104 | 105 | Xcode_convertUTF16To32Bit( uResult, iuResultLength, dwResult, &idwResultLength ); 106 | 107 | if ( memcmp( dwInput, dwResult, 4 ) != 0 ) 108 | { 109 | /* Error */ 110 | } 111 | } 112 | } 113 | 114 | void testPunycode( void ) 115 | { 116 | int res; 117 | UCHAR8 szOutput[1024]; 118 | DWORD dwInput[] = { 0x1d56f, 0x1e22, 0x3a5 }; 119 | UTF16CHAR uOutput[1024]; 120 | 121 | int iInputSize = 3; 122 | int iOutputSize = sizeof(szOutput); 123 | 124 | res = Xcode_puny_encodeString( dwInput, iInputSize, szOutput, &iOutputSize ); 125 | 126 | if ( res != XCODE_SUCCESS ) 127 | { 128 | /* Error */ 129 | } 130 | 131 | iInputSize = iOutputSize; 132 | iOutputSize = sizeof(uOutput); 133 | 134 | res = Xcode_puny_decodeString( szOutput, iInputSize, uOutput, &iOutputSize ); 135 | 136 | if ( res != XCODE_SUCCESS ) 137 | { 138 | /* Error */ 139 | } 140 | } 141 | 142 | void testRaceDecode( void ) 143 | { 144 | int res; 145 | UTF16CHAR uOutput[1024]; 146 | char * szIn = "bq--3b4mhtlrhbjsrzwy23orivhn"; 147 | 148 | int iInputSize = strlen(szIn); 149 | int iOutputSize = sizeof(uOutput); 150 | 151 | res = Xcode_race_decodeString( szIn, iInputSize, uOutput, &iOutputSize, "bq--", 4 ); 152 | 153 | if ( res != XCODE_SUCCESS ) 154 | { 155 | /* Error */ 156 | } 157 | } 158 | 159 | void testToASCII( void ) 160 | { 161 | int res; 162 | UTF16CHAR uInput[] = { 0x0070, 0x00E4, 0x00E4, 0x006F, 0x006D, 0x0061 }; 163 | UCHAR8 szOutput[1204]; 164 | 165 | int iInputSize = 6; 166 | int iOutputSize = sizeof(szOutput); 167 | 168 | res = Xcode_ToASCII( uInput, iInputSize, szOutput, &iOutputSize ); 169 | 170 | if ( res != XCODE_SUCCESS ) 171 | { 172 | /* Error */ 173 | } 174 | } 175 | 176 | void testDomainToASCII( void ) 177 | { 178 | int res; 179 | UTF16CHAR uInput[] = { 0x0077, 0x0077, 0x0077, 0x002E, 0x0066, 180 | 0x00FC, 0x006E, 0x0066, 0x0064, 0x3002, 0x006E, 0x0065, 0x0074 }; 181 | UCHAR8 szOutput[1204]; 182 | 183 | int iInputSize = 13; 184 | int iOutputSize = sizeof(szOutput); 185 | 186 | res = Xcode_DomainToASCII( uInput, iInputSize, szOutput, &iOutputSize ); 187 | 188 | if ( res != XCODE_SUCCESS ) 189 | { 190 | /* Error */ 191 | } 192 | } 193 | 194 | 195 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/unicode/unicode.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * Unicode * 4 | ********************************************************************************/ 5 | 6 | /* 7 | Purpose: This tool converts between Unicode data and Utf-16 using the surrogate arithmetic specified in 8 | the UTF-16 RFC. (see the References section in Appendices) 9 | 10 | Usage: unicode (encode|decode) 11 | 12 | Input type: Utf-16 for encode, Unicode for decode 13 | Output type: Unicode for encode, Utf-16 for decode 14 | */ 15 | 16 | #include "xcode.h" 17 | #include "../utility/utility.h" 18 | #include 19 | 20 | #ifdef WIN32 21 | #ifdef _DEBUG 22 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 23 | #else 24 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 25 | #endif 26 | #endif 27 | 28 | void buildUTF16Input() 29 | { 30 | int i; 31 | DWORD dwInput[5]; 32 | UTF16CHAR uResult[256]; 33 | int iuResultLength = 256; 34 | 35 | FILE * fp = fopen( "utf16.input.txt", "w" ); 36 | FILE * fpout = fopen( "utf16.output.txt", "w" ); 37 | 38 | for ( i = 0x90000; i <= 0x10FFFF; i = i + 4 ) 39 | { 40 | dwInput[0] = i; 41 | dwInput[1] = i+1; 42 | dwInput[2] = i+2; 43 | dwInput[3] = i+3; 44 | 45 | Xcode_convert32BitToUTF16( dwInput, 4, uResult, &iuResultLength ); 46 | 47 | fprintf( fp, "%x %x %x %x\n", uResult[0], uResult[1], uResult[2], uResult[3] ); 48 | fprintf( fpout, "%x %x %x %x\n", dwInput[0], dwInput[1], dwInput[2], dwInput[3] ); 49 | } 50 | fcloseall(); 51 | } 52 | 53 | int main(int argc, char* argv[]) 54 | { 55 | FILE * fpin; 56 | /*FILE * fpout;*/ 57 | char szIn[1024]; 58 | DWORD dwInput[1024]; 59 | DWORD dwOutput[1024]; 60 | UTF16CHAR uData[1024]; 61 | int iInputSize = 0; 62 | int iOutputSize = 0; 63 | int counter = 0; 64 | int res; 65 | int i; 66 | int encode = 0; 67 | 68 | /*buildUTF16Input(); return 0;*/ 69 | 70 | /* Arg check */ 71 | if (argc < 2) { 72 | printf("usage: (encode | decode) \n", argv[0] ); 73 | return 1; 74 | } 75 | 76 | /* Get file */ 77 | fpin = fopen(argv[2], "r"); 78 | if (fpin == NULL) { printf("Cannot open %s\n",argv[2]); return 1; } 79 | 80 | /*fpout = fopen( "tmp.output.txt", "w" );*/ 81 | 82 | if ( strcmp( argv[1], "encode" ) == 0 ) encode = 1; 83 | 84 | while ( !feof( fpin ) ) { 85 | memset( szIn, 0, sizeof(szIn) ); 86 | memset( dwInput, 0, sizeof(dwInput) ); 87 | memset( uData, 0, sizeof(uData) ); 88 | memset( dwOutput, 0, sizeof(dwOutput) ); 89 | 90 | fgets( szIn, sizeof(szIn), fpin ); 91 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) continue; 92 | 93 | /* Clip off \n */ 94 | szIn[strlen(szIn)-1] = 0; 95 | 96 | if ( encode ) { 97 | Read16BitLine( szIn, uData, &iInputSize ); 98 | } else { 99 | Read32BitLine( szIn, dwInput, &iInputSize ); 100 | } 101 | 102 | iOutputSize = 1024; 103 | 104 | if ( encode ) { 105 | res = Xcode_convertUTF16To32Bit( uData, iInputSize, dwOutput, &iOutputSize ); 106 | } else { 107 | res = Xcode_convert32BitToUTF16( dwInput, iInputSize, uData, &iOutputSize ); 108 | } 109 | 110 | counter++; 111 | 112 | if ( res != XCODE_SUCCESS ) { 113 | char szMsg[1024]; 114 | ConvertErrorCode( res, szMsg ); 115 | printf( "Fail: Line=%d '%25s' (%s)\n", counter, szMsg, szIn ); 116 | continue; 117 | } 118 | 119 | for( i = 0; i < iOutputSize; i++ ) { 120 | if ( encode ) { 121 | if ( i > 0 ) printf( " " ); 122 | printf( "%x", dwOutput[i] ); 123 | } else { 124 | if ( i > 0 ) printf( " " ); 125 | printf( "%x", uData[i] ); 126 | } 127 | } 128 | printf( "\n" ); 129 | 130 | } 131 | 132 | fclose(fpin); 133 | #ifdef WIN32 134 | getchar(); 135 | #endif 136 | return 0; 137 | 138 | } 139 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/test/utf8/utf8.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * Unicode * 4 | ********************************************************************************/ 5 | 6 | /* 7 | Purpose: This tool converts between Unicode data and Utf-16 using the surrogate arithmetic specified in 8 | the UTF-16 RFC. (see the References section in Appendices) 9 | 10 | Usage: unicode (encode|decode) 11 | 12 | Input type: Utf-16 for encode, Unicode for decode 13 | Output type: Unicode for encode, Utf-16 for decode 14 | */ 15 | 16 | #include "xcode.h" 17 | #include "../utility/utility.h" 18 | #include 19 | 20 | #ifdef WIN32 21 | #ifdef _DEBUG 22 | #pragma comment( lib, "../../../../../lib/win32/xcodelibdbg.lib" ) 23 | #else 24 | #pragma comment( lib, "../../../../../lib/win32/xcodelib.lib" ) 25 | #endif 26 | #endif 27 | 28 | void buildUTF16Input() 29 | { 30 | int i; 31 | DWORD dwInput[5]; 32 | UTF16CHAR uResult[256]; 33 | int iuResultLength = 256; 34 | 35 | FILE * fp = fopen( "utf16.input.txt", "w" ); 36 | FILE * fpout = fopen( "utf16.output.txt", "w" ); 37 | 38 | for ( i = 0x90000; i <= 0x10FFFF; i = i + 4 ) 39 | { 40 | dwInput[0] = i; 41 | dwInput[1] = i+1; 42 | dwInput[2] = i+2; 43 | dwInput[3] = i+3; 44 | 45 | Xcode_convert32BitToUTF16( dwInput, 4, uResult, &iuResultLength ); 46 | 47 | fprintf( fp, "%x %x %x %x\n", uResult[0], uResult[1], uResult[2], uResult[3] ); 48 | fprintf( fpout, "%x %x %x %x\n", dwInput[0], dwInput[1], dwInput[2], dwInput[3] ); 49 | } 50 | fcloseall(); 51 | } 52 | 53 | int main(int argc, char* argv[]) 54 | { 55 | FILE * fpin; 56 | /*FILE * fpout;*/ 57 | char szIn[1024]; 58 | char szInput[1024]; 59 | UTF16CHAR uzInput[1024]; 60 | UTF16CHAR uzOutput[1024]; 61 | UCHAR8 szOutput[1024]; 62 | int iInputSize = 0; 63 | int iOutputSize = 0; 64 | int counter = 0; 65 | int res; 66 | int i; 67 | int encode = 0; 68 | 69 | /*buildUTF16Input(); return 0;*/ 70 | 71 | /* Arg check */ 72 | if (argc < 2) { printf("usage: unicode [encode (to utf16)|decode (to unicode)] \n", argv[0] ); return 1; } 73 | 74 | /* Get file */ 75 | fpin = fopen(argv[2], "r"); 76 | if (fpin == NULL) { printf("Cannot open %s\n",argv[2]); return 1; } 77 | 78 | /*fpout = fopen( "tmp.output.txt", "w" );*/ 79 | 80 | if ( strcmp( argv[1], "encode" ) == 0 ) encode = 1; 81 | 82 | while ( !feof( fpin ) ) 83 | { 84 | memset( szIn, 0, sizeof(szIn) ); 85 | 86 | memset( uzInput, 0, sizeof(uzInput) ); 87 | memset( szInput, 0, sizeof(szInput) ); 88 | memset( uzOutput, 0, sizeof(uzOutput) ); 89 | memset( szOutput, 0, sizeof(szOutput) ); 90 | 91 | fgets( szIn, sizeof(szIn), fpin ); 92 | if ( szIn[0] == ' ' || szIn[0] == '#' || strlen( szIn ) < 2 ) continue; 93 | 94 | /* Clip off \n */ 95 | szIn[strlen(szIn)-1] = 0; 96 | 97 | if ( encode ) 98 | Read16BitLine( szIn, uzInput, &iInputSize ); 99 | else 100 | Read8BitLine( szIn, szInput, &iInputSize ); 101 | 102 | iOutputSize = 1024; 103 | 104 | if ( encode ) 105 | res = Xcode_convertUTF16ToUTF8( uzInput, iInputSize, szOutput, &iOutputSize ); 106 | else 107 | res = Xcode_convertUTF8ToUTF16( szInput, iInputSize, uzOutput, &iOutputSize ); 108 | 109 | counter++; 110 | 111 | if ( res != XCODE_SUCCESS ) 112 | { 113 | char szMsg[1024]; 114 | ConvertErrorCode( res, szMsg ); 115 | printf( "Fail: Line=%d '%25s' (%s)\n", counter, szMsg, szIn ); 116 | continue; 117 | } 118 | 119 | for( i = 0; i < iOutputSize; i++ ) 120 | { 121 | if ( encode ) 122 | { 123 | if ( i > 0 ) printf( " " ); 124 | printf( "%x", szOutput[i] ); 125 | } else { 126 | if ( i > 0 ) printf( " " ); 127 | printf( "%x", uzOutput[i] ); 128 | } 129 | } 130 | printf( "\n" ); 131 | 132 | } 133 | 134 | fclose(fpin); 135 | #ifdef WIN32 136 | getchar(); 137 | #endif 138 | return 0; 139 | 140 | } 141 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/xcode/headerexport/headerexport.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************************/ 2 | /* */ 3 | /* headerexport */ 4 | /* */ 5 | /* Command line entry point to headergen. */ 6 | /* */ 7 | /* (c) Verisign Inc., 2000-2003, All rights reserved */ 8 | /* */ 9 | /*********************************************************************************/ 10 | 11 | #include "xcode.h" 12 | #include "headergen.h" 13 | 14 | #include 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | Xcode_buildDataTables(); 19 | getchar(); 20 | return 0; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/xcode/headerexport/headergen.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************/ 2 | /* */ 3 | /* headergen */ 4 | /* */ 5 | /* Utility routines for generating inline nameprep and normalization */ 6 | /* data header files. */ 7 | /* */ 8 | /* (c) Verisign Inc., 2000-2003, All rights reserved */ 9 | /* */ 10 | /*********************************************************************************/ 11 | 12 | #ifndef _DATAFILECONVERSION_H_ 13 | #define _DATAFILECONVERSION_H_ 14 | 15 | #include "xcode_config.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" 19 | { 20 | #endif /* __cplusplus */ 21 | 22 | /*************************************************************************/ 23 | /* */ 24 | /* */ 25 | /* */ 26 | /* Xcode_buildAllDataTables */ 27 | /* */ 28 | /* */ 29 | /* */ 30 | /* Utility routine that builds inline nameprep and normalization data */ 31 | /* tables used by INLINE_NAMEPREP_DATA compiles. Generates static */ 32 | /* tables headers from data files specified in ace_config.h. Generates */ 33 | /* the following files: */ 34 | /* */ 35 | /* normalize_static_compatible.h */ 36 | /* normalize_static_composite.h */ 37 | /* normalize_static_canonical.h */ 38 | /* normalize_static_decompose.h */ 39 | /* nameprep_static_charmap.h */ 40 | /* nameprep_static_prohibit.h */ 41 | /* */ 42 | /* File location are based on a number of constants defined in */ 43 | /* xcode_config.h. See ace_config.h for more information. */ 44 | /* */ 45 | /* In the default distribution, all generated headers are present. */ 46 | /* Headers need only be generated when nameprep or normalization data */ 47 | /* files are updated to newer versions. */ 48 | /* */ 49 | /* Returns XCODE_SUCCESS if call was successful. */ 50 | /* */ 51 | int Xcode_buildDataTables( void ); 52 | /* */ 53 | /*************************************************************************/ 54 | 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif /* __cplusplus */ 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/xcode/inc/adapter.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* adapter */ 4 | /* */ 5 | /* Win32 Winsock replacement adapter for Race encoding. */ 6 | /* */ 7 | /* (c) Verisign Inc., 2000-2002, All rights reserved */ 8 | /* */ 9 | /*************************************************************************/ 10 | 11 | #ifndef _XCODE_WIN32_ADAPTER_H_ 12 | #define _XCODE_WIN32_ADAPTER_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" 16 | { 17 | #endif /* __cplusplus */ 18 | 19 | #ifdef WIN32 20 | #ifdef SUPPORT_RACE 21 | 22 | #pragma warning( disable : 4018 ) 23 | 24 | /* 25 | On Win32 platform, htons() is in the winsocks lib. 26 | To save a library load, we do it right here instead. 27 | */ 28 | 29 | #define INLINE_WORD_FLIP(out, in) \ 30 | { \ 31 | unsigned short int _in = (in); \ 32 | (out) = (_in << 8) | (_in >> 8);\ 33 | } 34 | 35 | #define INLINE_HTONS(out, in) INLINE_WORD_FLIP(out, in) 36 | 37 | #define INLINE_NTOHS(out, in) INLINE_WORD_FLIP(out, in) 38 | 39 | #define INLINE_DWORD_FLIP(out, in) \ 40 | { \ 41 | unsigned long int _in = (in); \ 42 | (out) = ((_in << 8) & 0x00ff0000) | \ 43 | (_in << 24) | \ 44 | ((_in >> 8) & 0x0000ff00) | \ 45 | (_in >> 24); \ 46 | } 47 | 48 | #define INLINE_NTOHL(out, in) INLINE_DWORD_FLIP(out, in) 49 | 50 | #define INLINE_HTONL(out, in) INLINE_DWORD_FLIP(out, in) 51 | 52 | static unsigned short int myhtons(unsigned short int in) 53 | { 54 | unsigned short int out; 55 | 56 | INLINE_WORD_FLIP(out,in); 57 | 58 | return out; 59 | } 60 | 61 | #endif 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif /* __cplusplus */ 67 | 68 | #endif /* _XCODE_WIN32_ADAPTER_H_ */ 69 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/xcode/inc/staticdata/nameprep_data.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* static nameprep data lookup tables */ 4 | /* */ 5 | /* Struct definitions and data file includes for inline normalization. */ 6 | /* */ 7 | /* (c) Verisign Inc., 2000-2002, All rights reserved */ 8 | /* */ 9 | /*************************************************************************/ 10 | 11 | #ifndef __nameprep_static_h__ 12 | #define __nameprep_static_h__ 13 | 14 | #ifdef __cplusplus 15 | extern "C" 16 | { 17 | #endif /* __cplusplus */ 18 | 19 | /* lookup table data structure definitions */ 20 | 21 | #include "nameprep_datastructures.h" 22 | 23 | /* static data lookup tables */ 24 | 25 | #include "nameprep_compatible.h" 26 | #include "nameprep_cononical.h" 27 | #include "nameprep_compose.h" 28 | #include "nameprep_decompose.h" 29 | #include "nameprep_charmap.h" 30 | #include "nameprep_bidi_randalcat.h" 31 | #include "nameprep_bidi_lcat.h" 32 | #ifdef AllowUnassigned 33 | #include "nameprep_prohibit_allowunassigned.h" 34 | #else 35 | #include "nameprep_prohibit.h" 36 | #endif 37 | 38 | /* data table lookup routines */ 39 | 40 | #include "staticdata/nameprep_lookups.h" 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif /* __cplusplus */ 45 | 46 | #endif /* __nameprep_static_h__ */ 47 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/c/xcode/inc/staticdata/nameprep_prohibit_allowunassigned.h: -------------------------------------------------------------------------------- 1 | /********************************************************************/ 2 | /* Data Type : Prohibit Nameprep Range Table */ 3 | /* Version : 11 */ 4 | /* This file automatically generated by xcode header export utility */ 5 | /********************************************************************/ 6 | 7 | #define PROHIBIT_ENTRYCOUNT 33 8 | const ProhibitRangesTable g_prohibitTable[PROHIBIT_ENTRYCOUNT] = { 9 | { /* low */ 0x000080, /* high */ 0x0000A0 }, 10 | { /* low */ 0x000340, /* high */ 0x000341 }, 11 | { /* low */ 0x0006DD, /* high */ 0x0006DD }, 12 | { /* low */ 0x00070F, /* high */ 0x00070F }, 13 | { /* low */ 0x001680, /* high */ 0x001680 }, 14 | { /* low */ 0x00180E, /* high */ 0x00180E }, 15 | { /* low */ 0x002000, /* high */ 0x00200F }, 16 | { /* low */ 0x002028, /* high */ 0x00202F }, 17 | { /* low */ 0x00205F, /* high */ 0x002063 }, 18 | { /* low */ 0x00206A, /* high */ 0x00206F }, 19 | { /* low */ 0x002FF0, /* high */ 0x002FFB }, 20 | { /* low */ 0x003000, /* high */ 0x003000 }, 21 | { /* low */ 0x00D800, /* high */ 0x00F8FF }, 22 | { /* low */ 0x00FDD0, /* high */ 0x00FDEF }, 23 | { /* low */ 0x00FEFF, /* high */ 0x00FEFF }, 24 | { /* low */ 0x00FFF9, /* high */ 0x00FFFF }, 25 | { /* low */ 0x01D173, /* high */ 0x01D17A }, 26 | { /* low */ 0x01FFFE, /* high */ 0x01FFFF }, 27 | { /* low */ 0x02FFFE, /* high */ 0x02FFFF }, 28 | { /* low */ 0x03FFFE, /* high */ 0x03FFFF }, 29 | { /* low */ 0x04FFFE, /* high */ 0x04FFFF }, 30 | { /* low */ 0x05FFFE, /* high */ 0x05FFFF }, 31 | { /* low */ 0x06FFFE, /* high */ 0x06FFFF }, 32 | { /* low */ 0x07FFFE, /* high */ 0x07FFFF }, 33 | { /* low */ 0x08FFFE, /* high */ 0x08FFFF }, 34 | { /* low */ 0x09FFFE, /* high */ 0x09FFFF }, 35 | { /* low */ 0x0AFFFE, /* high */ 0x0AFFFF }, 36 | { /* low */ 0x0BFFFE, /* high */ 0x0BFFFF }, 37 | { /* low */ 0x0CFFFE, /* high */ 0x0CFFFF }, 38 | { /* low */ 0x0DFFFE, /* high */ 0x0DFFFF }, 39 | { /* low */ 0x0E0001, /* high */ 0x0E0001 }, 40 | { /* low */ 0x0E0020, /* high */ 0x0E007F }, 41 | { /* low */ 0x0EFFFE, /* high */ 0x10FFFF }, 42 | }; 43 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/BidiL.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/BidiL.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/BidiOther.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/BidiOther.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/BidiProhibit.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/BidiProhibit.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/BidiRAL.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/BidiRAL.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/Charmap.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/Charmap.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/CompositionExclusions.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/CompositionExclusions.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/Illegal.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/Illegal.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/NormalizationTest.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/NormalizationTest.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/Prohibit.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/Prohibit.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/Unassigned.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/Unassigned.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/data/UnicodeData.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/data/UnicodeData.txt.gz -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/build/Makefile: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # NSI PROPRIETARY AND CONFIDENTIAL # 3 | # # 4 | # This information includes trade secrets and confidential commercial # 5 | # and/or financial information belonging to Network Solutions, Inc. (NSI). # 6 | # It is exempt from disclosure under the Freedom of Information Act. # 7 | # Unauthorized disclosure and/or use of this information without the # 8 | # express written consent of Network Solutions, Inc. is prohibited and # 9 | # may result in criminal prosecution and penalties pursuant to # 10 | # 18 U.S.C. section 1905. # 11 | # # 12 | # COPYRIGHT Network Solutions, Inc. (Unpublished Work) # 13 | # # 14 | # # 15 | # Third-Party Acknowledgements: # 16 | # # 17 | # - This product includes software developed by the # 18 | # Apache Software Foundation (http://www.apache.org/) # 19 | ############################################################################ 20 | 21 | 22 | .PHONY: package 23 | 24 | # This points to the root of the build 25 | SRC_DIR := .. 26 | 27 | # This is used to name the buildlogs 28 | DATE := $(shell date +%Y%m%d%H%M%S) 29 | 30 | # This is the location of all buildlogs 31 | LOGDIR := logs 32 | 33 | # These are the possible targets 34 | TARGETS := \ 35 | all\ 36 | init\ 37 | prepare\ 38 | pre-compile\ 39 | compile\ 40 | jar\ 41 | doc\ 42 | clean\ 43 | 44 | # Operating System switching 45 | UNAME = $(shell uname -s) 46 | ifeq ($(UNAME),AIX) 47 | OS = aix 48 | endif 49 | ifeq ($(UNAME),Linux) 50 | OS = linux 51 | endif 52 | ifeq ($(UNAME),SunOS) 53 | OS = solaris 54 | endif 55 | 56 | default: all 57 | 58 | prep: 59 | mkdir -p $(LOGDIR) 60 | 61 | help: 62 | @echo "make " 63 | @echo " target =" 64 | @for item in $(TARGETS); do \ 65 | echo " $$item"; \ 66 | done; 67 | 68 | $(TARGETS): prep 69 | ./build.sh -Dos.name=$(OS) -Djava.home=${JAVA_HOME} $@ 2>&1 | tee $(LOGDIR)/$(DATE).$@ 70 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/build/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set BASE_DIR=.. 7 | set LIB_DIR=%BASE_DIR%\..\..\lib 8 | 9 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 14 | 15 | rem ---- invoke ant to start the build ---- 16 | %JAVA_HOME%\bin\java -Dant.home=%BASE_DIR% -classpath %MYCLASSPATH% org.apache.tools.ant.Main %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/build/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ############################################################################ 3 | # NSI PROPRIETARY AND CONFIDENTIAL # 4 | # # 5 | # This document includes trade secrets and proprietary commercial and/or # 6 | # financial information (collectively "NSI Proprietary Information") # 7 | # belonging to Network Solutions, Inc. (NSI). Unauthorized disclosure # 8 | # and/or use of NSI Proprietary Information without the express written # 9 | # consent of Network Solutions, Inc. is strictly prohibited and may result # 10 | # in criminal prosecution and/or civil penalties pursuant to "The Economic # 11 | # Espionage Act of 1996", 18 U.S.C. Section 1831 et seq., and/or # 12 | # the "Virginia Uniform Trade Secrets Act", Va. Code Ann. Section 59.1-336.# 13 | # # 14 | # Copyright (c) Network Solutions, Inc. 2000. All Rights Reserved. # 15 | # # 16 | ############################################################################ 17 | 18 | 19 | if [ "$JAVA_HOME" = "" ] ; then 20 | echo "ERROR: JAVA_HOME not found in your environment." 21 | echo 22 | echo "Please, set the JAVA_HOME variable in your environment to match the" 23 | echo "location of the Java Virtual Machine you want to use." 24 | exit 1 25 | fi 26 | 27 | BASE_DIR=.. 28 | LIB_DIR=$BASE_DIR/../../lib 29 | 30 | LOCALCLASSPATH=\ 31 | $JAVA_HOME/lib/tools.jar:\ 32 | $JAVA_HOME/lib/dev.jar:\ 33 | $LIB_DIR/ant-optional.jar:\ 34 | $LIB_DIR/ant.jar:\ 35 | $LIB_DIR/jakarta-oro-2.0.7.jar:\ 36 | $LIB_DIR/xerces.jar:\ 37 | 38 | # Compile and Run test 39 | $JAVA_HOME/bin/java -Dant.home=$BASE_DIR -classpath $CLASSPATH:$LOCALCLASSPATH org.apache.tools.ant.Main $* 40 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/common/UnicodeMatrix.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* UnicodeMatrix.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: June, 2002 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.common; 14 | 15 | import java.io.*; 16 | import java.util.*; 17 | import com.vgrs.xcode.util.*; 18 | 19 | /** 20 | * Implements a set of Unicode codepoints and operations to determine whether 21 | * certain codepoints fall inside or outside the set. Two different data 22 | * structures are used to store codepoints internally. The THRESHOLD 23 | * attribute determines whether codepoints are stored in a MATRIX or a VECTOR 24 | * of ranges. Data below the threshold is stored in a matrix. Data above 25 | * the threshold is stored in a Vector of ranges. The matrix is faster but 26 | * requires more memory, so it is best to put densly packed but non 27 | * contiguous points into the matrix, and leave large ranges in the vector. 28 | * The threshold is interpreted as a number of bits. A threshold of 16 means 29 | * all points less than 2^16 or 0x10000 are stored in a matrix, all 30 | * points >= 0x10000 are stored as a list of ranges. Because the matrix is 31 | * stored internally as an array of char primatives, a threshold < 4 does not 32 | * make sense. Any threshold < 4 will be treated as a threshold of 0. No 33 | * matrix will be made, all data will be stored in ranges. 34 | */ 35 | 36 | public class UnicodeMatrix { 37 | 38 | static private final int LENGTH = 4096; 39 | 40 | private int plane; 41 | private int floor; 42 | private int ceiling; 43 | private char[] data = null; 44 | 45 | 46 | 47 | /** 48 | * Construct a UnicodeMatrix to store 65,535 flags 49 | * @param plane A number on the range [0-16] indicating the active plane. 50 | */ 51 | public UnicodeMatrix(int plane) { 52 | this.plane = plane; 53 | this.floor = plane * 0x10000; 54 | this.ceiling = (plane * 0x10000) + 0xffff; 55 | this.data = new char[4096]; 56 | } 57 | 58 | 59 | 60 | /** 61 | * Store a range in the UnicodeMatrix 62 | * @param range An integer array of length two. The first element is the 63 | * lower bound and the second element is the upper bound. 64 | */ 65 | public void insert(int[] range) { 66 | int j = range[0]; 67 | int k = range[1]; 68 | if (k < floor || j > ceiling) {return;} 69 | 70 | if (j < floor) { j = 0x0000; } 71 | else { j &= 0x0000ffff;} 72 | 73 | if (k > ceiling) { k = 0xffff; } 74 | else {k &= 0x0000ffff;} 75 | 76 | for (int i=j; i<=k; i++) {insert(i);} 77 | } 78 | 79 | 80 | 81 | /** 82 | * Store an integer in the UnicodeMatrix 83 | * @param i An integer to be inserted in matrix 84 | */ 85 | public void insert(int i) { 86 | data[(i>>4)] |= (1<<(i&0xf)); 87 | } 88 | 89 | 90 | 91 | /** 92 | * Return true if the given range fits completely inside the matrix. 93 | * @param range An integer array of length two. The first element is the 94 | * lower bound and the second element is the upper bound. 95 | */ 96 | public boolean spans(int[] range) { 97 | return (range[0] >= floor && range[1] <= ceiling); 98 | } 99 | 100 | 101 | 102 | /** 103 | * Test for intersection between a single integer and the UnicodeMatrix 104 | * @param input An integer 105 | */ 106 | public boolean test(int input) { 107 | return (((1<<(input&0x0000000f))&data[(input & 0x0000fff0)>>4]) > 0); 108 | } 109 | 110 | 111 | 112 | /** 113 | * Display the matrix data to standard output. 114 | */ 115 | public void show() { 116 | for (int i=0; i 0) { 39 | token = new int[len]; 40 | System.arraycopy(input,i-len,token,0,len); 41 | tmpResults.add(token); 42 | } 43 | if (returnDelims) { 44 | token = new int[1]; 45 | token[0] = input[i]; 46 | tmpResults.add(token); 47 | } 48 | len = 0; 49 | } else { 50 | len++; 51 | } 52 | } 53 | if (len > 0) { 54 | token = new int[len]; 55 | System.arraycopy(input,input.length-len,token,0,len); 56 | tmpResults.add(token); 57 | } 58 | this.results = tmpResults.elements(); 59 | } 60 | 61 | static private boolean exists(int item, int[] list) { 62 | for (int i=0; i 1) { 48 | String[] tmp = execute(input.substring(1)); 49 | result = new String[tmp.length * variant.length]; 50 | for (int i=0; i 2 | 3 | Classes providing data manipulation which is not specific to the IDNA rfc. 4 | 5 | 6 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/common/test/Base32Test.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* Base32Test.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: January, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | package com.vgrs.xcode.common.test; 13 | 14 | import java.io.*; 15 | import java.util.*; 16 | import com.vgrs.xcode.util.*; 17 | import com.vgrs.xcode.common.*; 18 | 19 | public class Base32Test { 20 | 21 | static public void usage() { 22 | System.out.println("usage: java Base32Test (encode | decode) "); 23 | } 24 | 25 | static public void main(String args[]) { 26 | if (args.length != 2) {usage();return;} 27 | 28 | if (args[0].equalsIgnoreCase("encode")) 29 | {testEncode(new File(args[1]));} 30 | else if (args[0].equalsIgnoreCase("decode")) 31 | {testDecode(new File(args[1]));} 32 | else {usage(); return;} 33 | } 34 | 35 | 36 | static public void testEncode(File input) { 37 | try { 38 | Iterator data = Datafile.getIterator(input); 39 | while (data.hasNext()) {testEncode((String)data.next());} 40 | } catch (Exception x) {x.printStackTrace();} 41 | } 42 | 43 | static public void testDecode(File input) { 44 | try { 45 | Iterator data = Datafile.getIterator(input); 46 | while (data.hasNext()) {testDecode((String)data.next());} 47 | } catch (Exception x) {x.printStackTrace();} 48 | } 49 | 50 | 51 | static public void testEncode(String input) throws XcodeException { 52 | byte[] inputarray = null; 53 | char[] output = null; 54 | byte[] check = null; 55 | 56 | if (input == null) { 57 | Debug.pass(""); 58 | return; 59 | } 60 | input = input.trim(); 61 | 62 | if (input.length() == 0 || input.charAt(0) == '#') { 63 | Debug.pass(input); 64 | return; 65 | } 66 | 67 | try { 68 | inputarray = Hex.decodeBytes(input); 69 | output = Base32.encode(inputarray); 70 | } catch (XcodeException x) { 71 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 72 | return; 73 | } 74 | 75 | try {check = Base32.decode(output);} 76 | catch (XcodeException x) { 77 | Debug.fail(input+" FATAL:"+x.getCode()+" "+x.getMessage()); 78 | return; 79 | } 80 | 81 | if (! Arrays.equals(inputarray,check)) { 82 | Debug.fail(input+" MISMATCH "+Hex.encode(check)); 83 | return; 84 | } 85 | 86 | Debug.pass(new String(output)); 87 | } 88 | 89 | 90 | static public void testDecode(String input) throws XcodeException { 91 | char[] inputarray = null; 92 | byte[] output = null; 93 | char[] check = null; 94 | 95 | if (input == null) { 96 | Debug.pass(""); 97 | return; 98 | } 99 | input = input.trim(); 100 | 101 | if (input.length() == 0 || input.charAt(0) == '#') { 102 | Debug.pass(input); 103 | return; 104 | } 105 | 106 | inputarray = input.toCharArray(); 107 | 108 | try {output = Base32.decode(inputarray);} 109 | catch (XcodeException x) { 110 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 111 | return; 112 | } 113 | 114 | try {check = Base32.encode(output);} 115 | catch (XcodeException x) { 116 | Debug.fail(input+" FATAL:"+x.getCode()+" "+x.getMessage()); 117 | return; 118 | } 119 | 120 | if (! input.equalsIgnoreCase(new String(check))) { 121 | Debug.fail(input+" MISMATCH "+new String(check)); 122 | return; 123 | } 124 | 125 | Debug.pass(Hex.encode(output)); 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/common/test/HexTest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* HexTest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: January, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | package com.vgrs.xcode.common.test; 13 | 14 | import java.io.*; 15 | import java.util.*; 16 | import com.vgrs.xcode.util.*; 17 | import com.vgrs.xcode.common.*; 18 | 19 | public class HexTest { 20 | 21 | static public void usage() { 22 | System.out.println("usage: java HexTest (encode | decode) "); 23 | } 24 | 25 | static public void main(String args[]) { 26 | if (args.length != 2) {usage();return;} 27 | 28 | if (args[0].equalsIgnoreCase("encode")) 29 | {testEncode(new File(args[1]));} 30 | else if (args[0].equalsIgnoreCase("decode")) 31 | {testDecode(new File(args[1]));} 32 | else {usage(); return;} 33 | } 34 | 35 | 36 | static public void testEncode(File input) { 37 | try { 38 | Iterator data = Datafile.getIterator(input); 39 | while (data.hasNext()) {testEncode((String)data.next());} 40 | } catch (Exception x) {x.printStackTrace();} 41 | } 42 | 43 | static public void testDecode(File input) { 44 | try { 45 | Iterator data = Datafile.getIterator(input); 46 | while (data.hasNext()) {testDecode((String)data.next());} 47 | } catch (Exception x) {x.printStackTrace();} 48 | } 49 | 50 | 51 | static public void testEncode(String input) throws XcodeException { 52 | String output = null; 53 | 54 | if (input == null) { 55 | Debug.pass(""); 56 | return; 57 | } 58 | //input = input.trim(); 59 | 60 | if (input.length() == 0 || input.charAt(0) == '#') { 61 | Debug.pass(input); 62 | return; 63 | } 64 | 65 | try { 66 | output = Hex.encode(input.toCharArray()); 67 | } catch (XcodeException x) { 68 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 69 | return; 70 | } 71 | 72 | Debug.pass(output); 73 | } 74 | 75 | 76 | static public void testDecode(String input) throws XcodeException { 77 | String output = null; 78 | if (input == null) { 79 | Debug.pass(""); 80 | return; 81 | } 82 | input = input.trim(); 83 | 84 | if (input.length() == 0 || input.charAt(0) == '#') { 85 | Debug.pass(input); 86 | return; 87 | } 88 | 89 | try {System.out.println(new String(Hex.decodeBytes(input)));} 90 | catch (XcodeException x1) { 91 | try {System.out.println(new String(Hex.decodeChars(input)));} 92 | catch (XcodeException x2) { 93 | try {System.out.println(new String(Unicode.decode(Hex.decodeInts(input))));} 94 | catch (XcodeException x3) { 95 | Debug.fail(input+" ERROR:"+x3.getCode()+" "+x3.getMessage()); 96 | return; 97 | } 98 | } 99 | } 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/common/test/UnicodeTest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* UnicodeTest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: January, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | package com.vgrs.xcode.common.test; 13 | 14 | import java.io.*; 15 | import java.util.*; 16 | import com.vgrs.xcode.util.*; 17 | import com.vgrs.xcode.common.*; 18 | 19 | 20 | public class UnicodeTest { 21 | 22 | static public void usage() { 23 | System.out.println("usage: java UnicodeTest (encode | decode) "); 24 | } 25 | 26 | static public void main(String args[]) { 27 | if (args.length != 2) {usage();return;} 28 | 29 | if (args[0].equalsIgnoreCase("encode")) 30 | {testEncode(new File(args[1]));} 31 | else if (args[0].equalsIgnoreCase("decode")) 32 | {testDecode(new File(args[1]));} 33 | else {usage(); return;} 34 | } 35 | 36 | 37 | static public void testEncode(File input) { 38 | try { 39 | Iterator data = Datafile.getIterator(input); 40 | while (data.hasNext()) {testEncode((String)data.next());} 41 | } catch (Exception x) {x.printStackTrace();} 42 | } 43 | 44 | static public void testDecode(File input) { 45 | try { 46 | Iterator data = Datafile.getIterator(input); 47 | while (data.hasNext()) {testDecode((String)data.next());} 48 | } catch (Exception x) {x.printStackTrace();} 49 | } 50 | 51 | 52 | static public void testEncode(String input) throws XcodeException { 53 | char[] inputarray = null; 54 | int[] output = null; 55 | char[] check = null; 56 | 57 | if (input == null) { 58 | Debug.pass(""); 59 | return; 60 | } 61 | input = input.trim(); 62 | 63 | if (input.length() == 0 || input.charAt(0) == '#') { 64 | Debug.pass(input); 65 | return; 66 | } 67 | 68 | try { 69 | inputarray = Hex.decodeChars(input); 70 | output = Unicode.encode(inputarray); 71 | } catch (XcodeException x) { 72 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 73 | return; 74 | } 75 | 76 | try {check = Unicode.decode(output);} 77 | catch (XcodeException x) { 78 | Debug.fail(input+" FATAL:"+x.getCode()+" "+x.getMessage()); 79 | return; 80 | } 81 | 82 | if (! Arrays.equals(inputarray,check)) { 83 | Debug.fail(input+" MISMATCH "+Hex.encode(check)); 84 | return; 85 | } 86 | 87 | Debug.pass(Hex.encode(output)); 88 | } 89 | 90 | 91 | static public void testDecode(String input) throws XcodeException { 92 | int[] inputarray = null; 93 | char[] output = null; 94 | int[] check = null; 95 | 96 | if (input == null) { 97 | Debug.pass(""); 98 | return; 99 | } 100 | input = input.trim(); 101 | 102 | if (input.length() == 0 || input.charAt(0) == '#') { 103 | Debug.pass(input); 104 | return; 105 | } 106 | 107 | try { 108 | inputarray = Hex.decodeInts(input); 109 | output = Unicode.decode(inputarray); 110 | } catch (XcodeException x) { 111 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 112 | return; 113 | } 114 | 115 | try {check = Unicode.encode(output);} 116 | catch (XcodeException x) { 117 | Debug.fail(input+" FATAL:"+x.getCode()+" "+x.getMessage()); 118 | return; 119 | } 120 | 121 | if (! Arrays.equals(inputarray,check)) { 122 | Debug.fail(input+" MISMATCH "+Hex.encode(check)); 123 | return; 124 | } 125 | 126 | Debug.pass(Hex.encode(output)); 127 | } 128 | 129 | } 130 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/ext/DCE.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* DCE.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: Srikanth Veeramachaneni */ 8 | /* @date: 09/10/2002 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.ext; 14 | 15 | import com.vgrs.xcode.util.*; 16 | import com.vgrs.xcode.common.*; 17 | 18 | 19 | 20 | /** 21 | * Makes a sequence of bytes compatible with the Domain Naming System. The 22 | * algorithm uses the Base 32 encoding to create data on the range [a-z, 2-7]. 23 | * Then data sequences longer than 63 characters are delimited using a 24 | * FULLSTOP character. 25 | */ 26 | 27 | public final class DCE { 28 | 29 | 30 | public static final int MAX_TOKEN_SIZE = 63; 31 | public static final char DELIMITER = 0x002E; 32 | 33 | 34 | /** 35 | * Convert array of bytes into a dns-compatible string 36 | * @param input sequence of bytes 37 | * @return array of dns-compatible bytes 38 | * @throws XcodeException if the input is null or empty 39 | */ 40 | static public char[] encode(byte[] input) throws XcodeException { 41 | 42 | if (input == null) throw XcodeError.NULL_ARGUMENT(); 43 | if (input.length == 0) throw XcodeError.EMPTY_ARGUMENT(); 44 | 45 | char[] dnsCompatibleBytes = null; 46 | char[] base32 = Base32.encode(input); 47 | 48 | // 49 | // if the number of base32 characters is greater than 63 50 | // insert a '.' after every 63 characters to make it dns compatible 51 | // 52 | if (base32.length > MAX_TOKEN_SIZE) { 53 | int delimsToInsert = base32.length / MAX_TOKEN_SIZE; 54 | dnsCompatibleBytes = new char[base32.length + delimsToInsert]; 55 | 56 | System.arraycopy(base32, 0, dnsCompatibleBytes, 0, MAX_TOKEN_SIZE); 57 | for(int i = 1; i <= delimsToInsert; i++) { 58 | int bytesToCopy = MAX_TOKEN_SIZE; 59 | if (base32.length < (i + 1) * MAX_TOKEN_SIZE) { 60 | bytesToCopy = base32.length - i * MAX_TOKEN_SIZE; 61 | } 62 | 63 | dnsCompatibleBytes[i * (MAX_TOKEN_SIZE + 1) - 1] = DELIMITER; 64 | System.arraycopy(base32, i * MAX_TOKEN_SIZE, 65 | dnsCompatibleBytes, i * (MAX_TOKEN_SIZE + 1), bytesToCopy); 66 | } 67 | } 68 | else { 69 | dnsCompatibleBytes = base32; 70 | } 71 | 72 | return dnsCompatibleBytes; 73 | } 74 | 75 | 76 | 77 | /** 78 | * Convert a dns-compatible string into array of bytes 79 | * @param input array of dns-compatible bytes 80 | * @return sequence of bytes 81 | * @throws XcodeException if the input is null or empty 82 | */ 83 | static public byte[] decode(char[] input) throws XcodeException { 84 | 85 | if (input == null) throw XcodeError.NULL_ARGUMENT(); 86 | if (input.length == 0) throw XcodeError.EMPTY_ARGUMENT(); 87 | 88 | char[] base32 = null; 89 | 90 | // 91 | // remove delimiters if present 92 | // 93 | if (input.length > MAX_TOKEN_SIZE) { 94 | int delimsToRemove = input.length / (MAX_TOKEN_SIZE + 1); 95 | base32 = new char[input.length - delimsToRemove]; 96 | 97 | System.arraycopy(input, 0, base32, 0, MAX_TOKEN_SIZE); 98 | for (int i = 1; i <= delimsToRemove; i++) { 99 | if (input[i * (MAX_TOKEN_SIZE + 1) - 1] != DELIMITER) { 100 | throw XcodeError.DCE_INVALID_DELIMITER(); 101 | } 102 | 103 | int bytesToCopy = MAX_TOKEN_SIZE; 104 | if (input.length < (i + 1) * (MAX_TOKEN_SIZE + 1)) { 105 | bytesToCopy = input.length - i * (MAX_TOKEN_SIZE + 1); 106 | } 107 | 108 | System.arraycopy(input, i * (MAX_TOKEN_SIZE + 1), 109 | base32, i * MAX_TOKEN_SIZE, bytesToCopy); 110 | } 111 | } 112 | else { 113 | base32 = input; 114 | } 115 | 116 | return Base32.decode(base32); 117 | } 118 | 119 | } // END class DCE 120 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/ext/EncodingVariants.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* EncodingVariants.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: January, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.ext; 14 | 15 | import java.io.*; 16 | import java.util.*; 17 | import com.vgrs.xcode.util.*; 18 | import com.vgrs.xcode.idna.*; 19 | import com.vgrs.xcode.common.*; 20 | 21 | 22 | /** 23 | * Class to generate encoding variants for an ACE encoded domain name and 24 | * encode them using DCE. 25 | */ 26 | 27 | public class EncodingVariants { 28 | 29 | static private Ace ace = null; 30 | 31 | public EncodingVariants (Ace ace) { 32 | this.ace = ace; 33 | } 34 | 35 | /** 36 | * Generate encoding variants for the given ACE domain name. Encode the 37 | * results using DCE. 38 | * @param input an ACE encoded domain name 39 | * @return encoding variants, the first element is the input 40 | * @throws XcodeException on invalid input 41 | */ 42 | public String[] execute(String input, String[] encodings) 43 | throws XcodeException { 44 | if (input == null) {throw XcodeError.NULL_ARGUMENT();} 45 | if (input.length() == 0) {throw XcodeError.EMPTY_ARGUMENT();} 46 | 47 | String tld = ""; 48 | int lastDotIndex = input.lastIndexOf('.'); 49 | if (lastDotIndex != -1) { 50 | tld = input.substring(lastDotIndex).toLowerCase(); 51 | input = input.substring(0, lastDotIndex); 52 | } 53 | 54 | String utf16 = new String(Unicode.decode(ace.decode(input.toCharArray()))); 55 | HashSet variants = null; 56 | if (encodings == null) {variants = Native.encodeToSet(utf16);} 57 | else {variants = Native.encodeToSet(utf16,encodings);} 58 | Iterator iterator = variants.iterator(); 59 | 60 | String[] results = new String[variants.size()]; 61 | int i = 0; 62 | while (iterator.hasNext()) { 63 | byte[] variant = Native.getEncoding((String)iterator.next()); 64 | results[i++] = new String(DCE.encode(variant))+tld; 65 | } 66 | 67 | return results; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/ext/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Classes which leverage components from the common and idna packages to accomplish a specific task. 4 | 5 | 6 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/ext/test/DCETest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* DCETest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: January, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | package com.vgrs.xcode.ext.test; 13 | 14 | import java.io.*; 15 | import java.util.*; 16 | import com.vgrs.xcode.ext.*; 17 | import com.vgrs.xcode.util.*; 18 | import com.vgrs.xcode.common.*; 19 | 20 | public class DCETest { 21 | 22 | static public void usage() { 23 | System.out.println("usage: java DCETest (encode | decode) "); 24 | } 25 | 26 | static public void main(String args[]) { 27 | if (args.length != 2) {usage();return;} 28 | 29 | if (args[0].equalsIgnoreCase("encode")) 30 | {testEncode(new File(args[1]));} 31 | else if (args[0].equalsIgnoreCase("decode")) 32 | {testDecode(new File(args[1]));} 33 | else {usage(); return;} 34 | } 35 | 36 | 37 | static public void testEncode(File input) { 38 | try { 39 | Iterator data = Datafile.getIterator(input); 40 | while (data.hasNext()) {testEncode((String)data.next());} 41 | } catch (Exception x) {x.printStackTrace();} 42 | } 43 | 44 | static public void testDecode(File input) { 45 | try { 46 | Iterator data = Datafile.getIterator(input); 47 | while (data.hasNext()) {testDecode((String)data.next());} 48 | } catch (Exception x) {x.printStackTrace();} 49 | } 50 | 51 | 52 | static public void testEncode(String input) throws XcodeException { 53 | byte[] inputarray = null; 54 | char[] output = null; 55 | byte[] check = null; 56 | 57 | if (input == null) { 58 | Debug.pass(""); 59 | return; 60 | } 61 | input = input.trim(); 62 | 63 | if (input.length() == 0 || input.charAt(0) == '#') { 64 | Debug.pass(input); 65 | return; 66 | } 67 | 68 | try { 69 | inputarray = Hex.decodeBytes(input); 70 | output = DCE.encode(inputarray); 71 | } catch (XcodeException x) { 72 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 73 | return; 74 | } 75 | 76 | try {check = DCE.decode(output);} 77 | catch (XcodeException x) { 78 | Debug.fail(input+" FATAL:"+x.getCode()+" "+x.getMessage()); 79 | return; 80 | } 81 | 82 | if (! Arrays.equals(inputarray,check)) { 83 | Debug.fail(input+" MISMATCH "+Hex.encode(check)); 84 | return; 85 | } 86 | 87 | Debug.pass(new String(output)); 88 | } 89 | 90 | 91 | static public void testDecode(String input) throws XcodeException { 92 | char[] inputarray = null; 93 | byte[] output = null; 94 | char[] check = null; 95 | 96 | if (input == null) { 97 | Debug.pass(""); 98 | return; 99 | } 100 | input = input.trim(); 101 | 102 | if (input.length() == 0 || input.charAt(0) == '#') { 103 | Debug.pass(input); 104 | return; 105 | } 106 | 107 | try { 108 | inputarray = input.toCharArray(); 109 | output = DCE.decode(inputarray); 110 | } catch (XcodeException x) { 111 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 112 | return; 113 | } 114 | 115 | try {check = DCE.encode(output);} 116 | catch (XcodeException x) { 117 | Debug.fail(input+" FATAL:"+x.getCode()+" "+x.getMessage()); 118 | return; 119 | } 120 | 121 | if (! input.equalsIgnoreCase(new String(check))) { 122 | Debug.fail(input+" MISMATCH "+new String(check)); 123 | return; 124 | } 125 | 126 | Debug.pass(Hex.encode(output)); 127 | } 128 | 129 | } 130 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/ext/test/EncodingVariantsTest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* EncodingVariantsTest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: January, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.ext.test; 14 | 15 | import java.io.*; 16 | import java.util.*; 17 | import com.vgrs.xcode.ext.*; 18 | import com.vgrs.xcode.util.*; 19 | import com.vgrs.xcode.idna.*; 20 | import com.vgrs.xcode.common.*; 21 | 22 | public class EncodingVariantsTest { 23 | 24 | static public EncodingVariants ev; 25 | 26 | static public void usage() { 27 | System.out.println("usage: java EncodingVariantsTest [-r] "); 28 | System.out.println(" -r => use Race for ACE encoding (Punycode by default)"); 29 | } 30 | 31 | static public void main(String args[]) { 32 | if (args.length < 1) {usage();return;} 33 | 34 | int i = 0; 35 | 36 | if (args[0].equals("-r")) {ev = new EncodingVariants(new Race()); i++;} 37 | else { ev = new EncodingVariants(new Punycode()); } 38 | 39 | File infile = new File(args[i++]); 40 | 41 | if (args.length == i) { 42 | testExecute(infile,null); 43 | } else { 44 | String[] encodings = new String[args.length - i]; 45 | System.arraycopy(args,i,encodings,0,encodings.length); 46 | testExecute(infile,encodings); 47 | } 48 | } 49 | 50 | static public void testExecute(File input, String[] encodings) { 51 | try { 52 | Iterator data = Datafile.getIterator(input); 53 | while (data.hasNext()) {testExecute((String)data.next(),encodings);} 54 | } catch (Exception x) {x.printStackTrace();} 55 | } 56 | 57 | static public void testExecute(String input, String[] encodings) 58 | throws XcodeException { 59 | String[] output = null; 60 | 61 | if (input == null) { 62 | Debug.pass(""); 63 | return; 64 | } 65 | input = input.trim(); 66 | 67 | if (input.length() == 0 || input.charAt(0) == '#') { 68 | Debug.pass(input); 69 | return; 70 | } 71 | 72 | try {output = ev.execute(input,encodings);} 73 | catch (XcodeException x) { 74 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 75 | return; 76 | } 77 | 78 | if (output == null || output.length == 0) { 79 | Debug.pass(input+" -> "); 80 | } 81 | else if (output.length == 1) { 82 | Debug.pass(input+" -> "+output[0]); 83 | } 84 | else { 85 | System.out.println("\n"+input); 86 | for (int i=0; i "+output[i]); 88 | } 89 | System.out.println(); 90 | } 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/idna/Bidi.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* Bidi.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: February, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.idna; 14 | 15 | import java.io.*; 16 | import java.util.*; 17 | import com.vgrs.xcode.util.*; 18 | import com.vgrs.xcode.common.*; 19 | 20 | /** 21 | * Prevents certain groupings of unicode characters from IDN registration. 22 | * The Stringprep draft prescribes the prohibition of characters which 23 | * "Change display properties or are deprecated" (Section 5.8) These 24 | * characters are prohibited during the Nameprep Prohibition step as well. 25 | * To avoid redundant prohibition of these characters, a boolean parameter 26 | * is offered in the constructor allowing applications to opt out of the 27 | * Bidi prohibition step. 28 | */ 29 | public class Bidi { 30 | 31 | static public final boolean DEFAULT_PROHIBIT = false; 32 | 33 | static public final int BIDI_PROHIBIT_THRESHOLD = 0; 34 | static public final int BIDI_L_THRESHOLD = 17; 35 | static public final int BIDI_RAL_THRESHOLD = 16; 36 | 37 | static public final String BIDI_PROHIBIT_DATA = "data/BidiProhibit.txt.gz"; 38 | static public final String BIDI_L_DATA = "data/BidiL.txt.gz"; 39 | static public final String BIDI_RAL_DATA = "data/BidiRAL.txt.gz"; 40 | 41 | static public final String PROHIBIT_PREFIX = "Bidi prohibited "; 42 | 43 | private UnicodeFilter bidi_prohibit = null; 44 | private UnicodeFilter bidi_l = null; 45 | private UnicodeFilter bidi_ral = null; 46 | private boolean prohibit; 47 | 48 | public Bidi() throws XcodeException { 49 | this(DEFAULT_PROHIBIT); 50 | } 51 | public Bidi(boolean prohibit) throws XcodeException { 52 | this.prohibit = prohibit; 53 | if (prohibit) { 54 | bidi_prohibit = new UnicodeFilter(BIDI_PROHIBIT_THRESHOLD,PROHIBIT_PREFIX); 55 | bidi_prohibit.apply(BIDI_PROHIBIT_DATA); 56 | } 57 | bidi_l = new UnicodeFilter(BIDI_L_THRESHOLD); 58 | bidi_l.apply(BIDI_L_DATA); 59 | bidi_ral = new UnicodeFilter(BIDI_RAL_THRESHOLD); 60 | bidi_ral.apply(BIDI_RAL_DATA); 61 | } 62 | 63 | 64 | /** 65 | * Use UnicodeFilter object to check if there is a prohibited 66 | * unicode in an integer array 67 | * @param input an integer array 68 | * @throws XcodeException Bidi rule is violated 69 | */ 70 | public void test(int[] input) throws XcodeException { 71 | boolean anyL = false; 72 | boolean anyRAL = false; 73 | if (prohibit) {bidi_prohibit.test(input);} 74 | if (input.length > 1) { 75 | boolean firstAndLast = bidi_ral.test(input[0]) && 76 | bidi_ral.test(input[input.length-1]); 77 | for (int i=0; i 2 | 3 | Classes implementing the solutions proposed in the IDNA rfc. These include the elements of Nameprep as well as ACE encodings. 4 | 5 | 6 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/idna/test/BidiTest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* BidiTest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: February, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.idna.test; 14 | 15 | import java.io.*; 16 | import java.util.*; 17 | import com.vgrs.xcode.util.*; 18 | import com.vgrs.xcode.idna.*; 19 | import com.vgrs.xcode.common.*; 20 | 21 | 22 | public class BidiTest { 23 | 24 | static private Bidi bidi; 25 | 26 | static public void usage() { 27 | System.out.println("usage: java BidiTest [-p] "); 28 | System.out.println(" -p => apply the Bidi prohibition step"); 29 | } 30 | 31 | static public void main(String args[]) { 32 | if (args.length < 1) {usage();return;} 33 | 34 | int i = 0; 35 | try { 36 | if (args[0].equalsIgnoreCase("-p")) { 37 | bidi = new Bidi(true); 38 | i++; 39 | } 40 | else if (args[0].equalsIgnoreCase("-t")) { 41 | bidi = new Bidi(true); 42 | bidi.show(); 43 | return; 44 | } 45 | else {bidi = new Bidi(false);} 46 | } catch (Exception x) {x.printStackTrace();} 47 | 48 | testExecute(new File(args[i])); 49 | } 50 | 51 | 52 | static public void testExecute(File input) { 53 | try { 54 | Iterator data = Datafile.getIterator(input); 55 | while (data.hasNext()) {testExecute((String)data.next());} 56 | } catch (Exception x) {x.printStackTrace();} 57 | } 58 | 59 | 60 | static public void testExecute(String input) throws XcodeException { 61 | if (input == null) { 62 | Debug.pass(""); 63 | return; 64 | } 65 | input = input.trim(); 66 | 67 | if (input.length() == 0 || input.charAt(0) == '#') { 68 | Debug.pass(input); 69 | return; 70 | } 71 | 72 | try {bidi.test(Hex.decodeInts(input));} 73 | catch (XcodeException x) { 74 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 75 | return; 76 | } 77 | 78 | Debug.pass(input); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/idna/test/CharmapTest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* CharmapTest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: February, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | package com.vgrs.xcode.idna.test; 13 | 14 | import java.io.*; 15 | import java.util.*; 16 | import com.vgrs.xcode.util.*; 17 | import com.vgrs.xcode.idna.*; 18 | import com.vgrs.xcode.common.*; 19 | 20 | 21 | 22 | public class CharmapTest { 23 | 24 | static public void usage() { 25 | System.out.println("usage: java CharmapTest [-d] "); 26 | } 27 | 28 | static public void main(String args[]) { 29 | if (args.length < 1) {usage();return;} 30 | 31 | int i = 0; 32 | try { 33 | if (args[0].equalsIgnoreCase("-d")) { 34 | dump(); 35 | if (args.length==1) {return;} 36 | i++; 37 | } 38 | } catch (Exception x) {x.printStackTrace();} 39 | testExecute(new File(args[i])); 40 | } 41 | 42 | 43 | static public void testExecute(File input) { 44 | try { 45 | Iterator data = Datafile.getIterator(input); 46 | while (data.hasNext()) {testExecute((String)data.next());} 47 | } catch (Exception x) {x.printStackTrace();} 48 | } 49 | 50 | 51 | static public void testExecute(String input) throws XcodeException { 52 | int[] output = null; 53 | 54 | if (input == null) { 55 | Debug.pass(""); 56 | return; 57 | } 58 | input = input.trim(); 59 | 60 | if (input.length() == 0 || input.charAt(0) == '#') { 61 | Debug.pass(input); 62 | return; 63 | } 64 | 65 | try {output = Charmap.execute(Hex.decodeInts(input));} 66 | catch (XcodeException x) { 67 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 68 | return; 69 | } 70 | 71 | Debug.pass(Hex.encode(output)); 72 | } 73 | 74 | static public void dump() { 75 | try { 76 | Integer key = null; 77 | int[] value = null; 78 | Iterator i = Charmap.CHARMAP_HASH.keySet().iterator(); 79 | while (i.hasNext()) { 80 | key = (Integer)i.next(); 81 | value = (int[])Charmap.CHARMAP_HASH.get(key); 82 | System.out.print(Integer.toString(key.intValue(),16)+" => "); 83 | if (value.length > 0) {System.out.print(Hex.encode(value));} 84 | System.out.println(); 85 | } 86 | } catch (Exception x) {x.printStackTrace();} 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/idna/test/NameprepTest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* NameprepTest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: February, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | package com.vgrs.xcode.idna.test; 13 | 14 | import java.io.*; 15 | import java.util.*; 16 | import com.vgrs.xcode.util.*; 17 | import com.vgrs.xcode.idna.*; 18 | import com.vgrs.xcode.common.*; 19 | 20 | 21 | public class NameprepTest { 22 | 23 | static public Nameprep nameprep; 24 | 25 | static public void usage() { 26 | System.out.println("usage: java NameprepTest [-a] "); 27 | System.out.println(" -a => allow unassigned codepoints (disallowed by default)"); 28 | } 29 | 30 | static public void main(String args[]) { 31 | if (args.length < 1) {usage();return;} 32 | 33 | int i = 0; 34 | try { 35 | if (args[0].equalsIgnoreCase("-a")) {nameprep = new Nameprep(true);i++;} 36 | else {nameprep = new Nameprep(false);} 37 | } catch (Exception x) {x.printStackTrace();} 38 | 39 | testExecute(new File(args[i])); 40 | } 41 | 42 | 43 | static public void testExecute(File input) { 44 | try { 45 | Iterator data = Datafile.getIterator(input); 46 | while (data.hasNext()) {testExecute((String)data.next());} 47 | } catch (Exception x) {x.printStackTrace();} 48 | } 49 | 50 | 51 | static public void testExecute(String input) throws XcodeException { 52 | int[] output = null; 53 | 54 | if (input == null) { 55 | Debug.pass(""); 56 | return; 57 | } 58 | input = input.trim(); 59 | 60 | if (input.length() == 0 || input.charAt(0) == '#') { 61 | Debug.pass(input); 62 | return; 63 | } 64 | 65 | try {output = nameprep.domainExecute(Hex.decodeInts(input));} 66 | catch (XcodeException x) { 67 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 68 | return; 69 | } 70 | 71 | Debug.pass(Hex.encode(output)); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/idna/test/NormalizeTest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* NormalizeTest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: February, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | package com.vgrs.xcode.idna.test; 13 | 14 | import java.io.*; 15 | import java.util.*; 16 | import com.vgrs.xcode.util.*; 17 | import com.vgrs.xcode.idna.*; 18 | import com.vgrs.xcode.common.*; 19 | 20 | 21 | public class NormalizeTest { 22 | 23 | static public void usage() { 24 | System.out.println("usage: java NormalizeTest [-c] "); 25 | } 26 | 27 | 28 | static public void main(String args[]) { 29 | if (args.length < 1) {usage();return;} 30 | 31 | if (args.length == 1) { 32 | testExecute(new File(args[0])); 33 | } 34 | else if (args.length == 2 && args[0].equals("-c")) { 35 | testConformance(new File(args[1])); 36 | } 37 | else { 38 | usage(); 39 | return; 40 | } 41 | } 42 | 43 | 44 | static public void testExecute(File input) { 45 | try { 46 | Iterator data = Datafile.getIterator(input); 47 | while (data.hasNext()) {testExecute((String)data.next());} 48 | } catch (Exception x) {x.printStackTrace();} 49 | } 50 | 51 | 52 | static public void testExecute(String input) throws XcodeException { 53 | int[] output = null; 54 | 55 | if (input == null) { 56 | Debug.pass(""); 57 | return; 58 | } 59 | input = input.trim(); 60 | 61 | if (input.length() == 0 || input.charAt(0) == '#') { 62 | Debug.pass(input); 63 | return; 64 | } 65 | 66 | try { 67 | output = Normalize.execute(Hex.decodeInts(input)); 68 | } catch (XcodeException x) { 69 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 70 | return; 71 | } 72 | 73 | Debug.pass(Hex.encode(output)); 74 | } 75 | 76 | 77 | 78 | static public void testConformance(File input) { 79 | try { 80 | Iterator data = Datafile.getIterator(input); 81 | while (data.hasNext()) {testConformance((String)data.next());} 82 | } catch (Exception x) {x.printStackTrace();} 83 | } 84 | 85 | 86 | static public void testConformance(String input) throws XcodeException { 87 | 88 | if (input == null) { 89 | Debug.pass(""); 90 | return; 91 | } 92 | input = input.trim(); 93 | int hashIndex = input.indexOf('#'); 94 | if (hashIndex > 0) { 95 | input = input.substring(0, hashIndex); 96 | input = input.trim(); 97 | } 98 | 99 | if ( input.length() == 0 100 | || input.charAt(0) == '#' 101 | || input.charAt(0) == '@') 102 | { 103 | // Debug.pass(input); 104 | return; 105 | } 106 | 107 | // 108 | // parse the data into columns 109 | // 110 | StringTokenizer st = new StringTokenizer(input, ";"); 111 | int tokenCount = st.countTokens(); 112 | if (tokenCount < 5) { 113 | Debug.fail(input + " ERROR: Invalid number of columns"); 114 | return; 115 | } 116 | int index = 0; 117 | String[] column = new String[tokenCount]; 118 | while (st.hasMoreTokens()) { 119 | column[index++] = st.nextToken(); 120 | } 121 | 122 | // 123 | // parse first 5 columns from hex format 124 | // 125 | int[][] c = new int[5][]; 126 | try { 127 | for (index = 0; index < 5; index++) { 128 | c[index] = Hex.decodeInts(column[index]); 129 | } 130 | } 131 | catch (XcodeException x) { 132 | Debug.fail(input+" ERROR:["+column[index]+"]"+x.getCode()+" "+x.getMessage()); 133 | return; 134 | } 135 | 136 | try { 137 | // 138 | // ensure conformance for NFKC 139 | // c4 == NFKC(c1) == NFKC(c2) == NFKC(c3) == NFKC(c4) == NFKC(c5) 140 | // 141 | for (int i = 0; i < 5; i++) { 142 | int[] nfkc = Normalize.execute(getCopy(c[i])); 143 | if ( ! Arrays.equals(c[3], nfkc)) { 144 | Debug.fail(input 145 | + " ERROR: conformance test failed: col[4] = '" 146 | + Hex.encode(c[3]) + "': col[" + (i+1) + "] = '" + Hex.encode(c[i]) 147 | + "': NFKC[" + (i+1) + "] = '" + Hex.encode(nfkc) + "'"); 148 | } 149 | } 150 | 151 | } 152 | catch (XcodeException x) { 153 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 154 | return; 155 | } 156 | 157 | } 158 | 159 | static private int[] getCopy(int[] arr) { 160 | int[] copy = new int[arr.length]; 161 | System.arraycopy(arr, 0, copy, 0, arr.length); 162 | return copy; 163 | } 164 | 165 | } 166 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/idna/test/ProhibitTest.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* ProhibitTest.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: February, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.idna.test; 14 | 15 | import java.io.*; 16 | import java.util.*; 17 | import com.vgrs.xcode.util.*; 18 | import com.vgrs.xcode.idna.*; 19 | import com.vgrs.xcode.common.*; 20 | 21 | 22 | public class ProhibitTest { 23 | 24 | static private Prohibit prohibit; 25 | 26 | static public void usage() { 27 | System.out.println("usage: java ProhibitTest [-a] "); 28 | System.out.println(" -a => allow unassigned codepoints (disallowed by default)"); 29 | } 30 | 31 | static public void main(String args[]) { 32 | if (args.length < 1) {usage();return;} 33 | 34 | int i = 0; 35 | try { 36 | if (args[0].equalsIgnoreCase("-a")) {prohibit = new Prohibit(true);i++;} 37 | else {prohibit = new Prohibit(false);} 38 | } catch (Exception x) {x.printStackTrace();} 39 | 40 | //prohibit.showMatrix(); 41 | //prohibit.showList(); 42 | testExecute(new File(args[i])); 43 | } 44 | 45 | 46 | static public void testExecute(File input) { 47 | try { 48 | Iterator data = Datafile.getIterator(input); 49 | while (data.hasNext()) {testExecute((String)data.next());} 50 | } catch (Exception x) {x.printStackTrace();} 51 | } 52 | 53 | 54 | static public void testExecute(String input) throws XcodeException { 55 | if (input == null) { 56 | Debug.pass(""); 57 | return; 58 | } 59 | input = input.trim(); 60 | 61 | if (input.length() == 0 || input.charAt(0) == '#') { 62 | Debug.pass(input); 63 | return; 64 | } 65 | 66 | try {prohibit.test(Hex.decodeInts(input));} 67 | catch (XcodeException x) { 68 | Debug.fail(input+" ERROR:"+x.getCode()+" "+x.getMessage()); 69 | return; 70 | } 71 | 72 | Debug.pass(input); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/Animation.java: -------------------------------------------------------------------------------- 1 | package com.vgrs.xcode.jnlp; 2 | 3 | import java.awt.*; 4 | import javax.swing.*; 5 | 6 | /** 7 | * A class used to implement a browser like animation that only runs during 8 | * calculation. After much experimenting with Java's Thread Priority 9 | * support, and much failure, we've abandoned that approach. Instead, this 10 | * object offers a next() method which allows callers to explicitly show the 11 | * next image. This way a single Thread can control it's own process as well 12 | * as the animation. After instantiating, a call to the Animation's next() 13 | * method should be placed somewhere in the main calculation loop. 14 | */ 15 | public class Animation extends JLabel { 16 | 17 | /** 18 | * All images loaded are scaled to a certain dimension using the scaling 19 | * algorithm specified by this constant. 20 | *
This variable is hard coded to the value 21 | * Image.SCALE_FAST 22 | */ 23 | static public final int SCALE_TYPE = Image.SCALE_FAST; 24 | 25 | // Internals 26 | static private ClassLoader loader = Animation.class.getClassLoader(); 27 | static private Toolkit kit = Toolkit.getDefaultToolkit(); 28 | 29 | // Object attributes 30 | private MediaTracker tracker; 31 | private Image[] images; 32 | private int length; 33 | private int width; 34 | private int height; 35 | private int frame; 36 | private long last; 37 | private int delay; 38 | 39 | private Image offImage; 40 | private Graphics offGraphics; 41 | 42 | 43 | /** 44 | * Construct an Animation object. 45 | * @param src An array of resources which point to slides in the animation. 46 | * @param width The width of the slides 47 | * @param height The height of the slides 48 | * @param fps The Frames-Per-Second to show 49 | */ 50 | public Animation(String[] src, int width, int height, int fps) { 51 | super(); 52 | this.width = width; 53 | this.height = height; 54 | this.setSize(width,height); 55 | this.setPreferredSize(new Dimension(width,height)); 56 | length = src.length; 57 | images = new Image[length]; 58 | tracker = new MediaTracker(this); 59 | for (int i=0; i 0) ? (1000 / fps) : 100; 66 | 67 | offImage = null; 68 | offGraphics = null; 69 | } 70 | 71 | 72 | /** 73 | * Show the next slide in the animation. 74 | */ 75 | public void next() { 76 | long click = System.currentTimeMillis(); 77 | if (click - last > delay) { 78 | frame++; 79 | paint(this.getGraphics()); 80 | last = click; 81 | } 82 | } 83 | 84 | 85 | /** 86 | * Display the Animation 87 | * @param g A Graphics object on which to draw 88 | */ 89 | public void paint(Graphics g) { 90 | update(g); 91 | } 92 | 93 | 94 | /** 95 | * A double-buffered display implementation 96 | * @param g A Graphics object on which to draw 97 | */ 98 | public void update(Graphics g) { 99 | // Create the off-buffer 100 | Dimension d = this.getSize(); 101 | if ((offGraphics == null) || 102 | (d.width != width) || 103 | (d.height != height)) { 104 | this.setSize(width,height); 105 | offImage = createImage(width, height); 106 | offGraphics = offImage.getGraphics(); 107 | } 108 | 109 | // Erase the off-buffer 110 | offGraphics.setColor(getBackground()); 111 | offGraphics.fillRect(0, 0, width, height); 112 | offGraphics.setColor(Color.black); 113 | 114 | // Paint the image onto the off-buffer 115 | paintFrame(offGraphics); 116 | 117 | // Paint the off-buffer onto the screen 118 | g.drawImage(offImage, 0, 0, null); 119 | } 120 | 121 | 122 | /** 123 | * Wait until all frames have been loaded, then draw 124 | * @param g A Graphics object on which to draw 125 | */ 126 | public void paintFrame(Graphics g) { 127 | if (tracker.statusID(0, true) == MediaTracker.COMPLETE) { 128 | g.drawImage(images[frame % length], 0, 0, null); 129 | } 130 | } 131 | 132 | 133 | private void log(String msg) { 134 | System.err.println(msg); 135 | } 136 | 137 | 138 | private Image loadImage(String i, int w, int h) { 139 | return kit.getImage(loader.getResource(i)).getScaledInstance(w,h,SCALE_TYPE); 140 | } 141 | 142 | } 143 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/Converter.jnlp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | IDNA Client 10 | VeriSign Inc. 11 | 12 | International Character Conversion Client 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-1.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-2.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-3.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-4.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-5.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-6.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-7.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/Cheetah/Cheetah-8.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/VeriSign-Medium.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/VeriSign-Medium.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/VeriSign-Small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/images/VeriSign-Small.gif -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | Download Java Web Start 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/jnlp/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Classes implementing a Graphical User Interface for IDNA conversions. The solution uses Java Web Start over the Java Network Launching Protocol to distribute the application to client machines. 4 | 5 |

Instructions for the distribution of this client. 6 | 7 |

1. The Converter.jnlp file contains the xml code which will launch the Converter application remotely. This code must reference the webserver from which the Converter application will be remotely launched. Replace any reference to "10.131.29.44" with a reference to the actual ip or domain name of the hosting webserver. 8 | 9 |

2. The index.html file contains html code which will first determine whether the end-user already has the Java Web Start software installed. If not, then Java Web Start will be automatically downloaded before proceeding to download the Converter application. This code must reference the webserver from which the Converter application will be remotely launched. Replace any reference to "10.131.29.44" with a reference to the actual ip or domain name of the hosting webserver. 10 | 11 |

3. Copy the Converter.jnlp, index.html, and IDNSDK.jar files from their locations within the software, to a directory within the local webserver. If using Tomcat for instance, copy all three files to the $CATALINA_HOME/webapps/ROOT directory. 12 | 13 |

4. Download the file "j2re-1_4_2_04-windows-i586-p-iftw.exe" from the Sun website. Place this file in the same directory as the other conversion files on the webserver. 14 | 15 |

5. Sign the JAR file. Java Web Start software will refuse to launch software which has not been signed. Issue the following commands: 16 |
  keytool -genkey -keystore .keystore -alias MyCompany 17 |
  jarsigner -keystore .keystore IDNSDK.jar MyCompany 18 | 19 |

6. Start the webserver. 20 | 21 |

7. Surf to the index.html page for Java Web Start installation followed by Converter application launch. Surf directly to Converter.jnlp for immediate application launch. 22 | 23 | 24 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/util/Debug.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* Debug.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: June, 2002 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | package com.vgrs.xcode.util; 13 | 14 | import java.io.*; 15 | import java.util.*; 16 | 17 | /** 18 | * Log debugging information to System.out/System.err. 19 | */ 20 | public class Debug { 21 | 22 | /** 23 | * Log information to Standard Error. This method can be used to display 24 | * debug information during development. 25 | * @param input A message to log 26 | */ 27 | static public void log(String input) { 28 | System.err.println(input); 29 | } 30 | 31 | /** 32 | * Log information to Standard Out. This method is commonly used in test 33 | * routines to display output after a successful execution. Input is not 34 | * modified. 35 | * @param input A message to log 36 | */ 37 | static public void pass(String input) { 38 | System.out.println(input); 39 | } 40 | 41 | /** 42 | * Log information to Standard Error. This method is commonly used in test 43 | * routines to display output after a failed execution. A "Number Sign" (#) 44 | * character is prefixed to the input. This facilitates sequenced executions 45 | * on the command-line. For instance, users can use the "race" command to 46 | * decode an input file, and write the contents out to an output file. This 47 | * entire output file can then be fed into the "idna" routine. Records 48 | * which failed the original race decode will be ignored by the idna routine 49 | * because they have been prefixed with a "#" character. 50 | * @param input A message to log 51 | */ 52 | static public void fail(String input) { 53 | System.err.println("# "+input); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/util/XcodeErrorGenerator.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* XcodeErrorGenerator.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: January, 2003 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.util; 14 | 15 | import java.io.*; 16 | import java.util.*; 17 | import com.vgrs.xcode.common.*; 18 | 19 | /** 20 | * Generates XcodeError object on the fly. The XcodeError object reads in 21 | * error codes from the ErrorCodes.txt source file. 22 | */ 23 | 24 | public class XcodeErrorGenerator { 25 | 26 | static public final String EMPTY = ""; 27 | static public final char DELIMITER = '\t'; 28 | 29 | static public void usage() { 30 | System.out.println("usage: java XcodeErrorGenerator "); 31 | } 32 | 33 | static public void main(String args[]) { 34 | if (args.length != 2) {usage();return;} 35 | generate(new File(args[0]),new File(args[1])); 36 | } 37 | 38 | static public String getHeader() { 39 | String header = new String(); 40 | header += "/*\n * This source file is constructed from the ErrorCodes.txt\n"; 41 | header += " * file in the data directory. Do not modify.\n */\n\n"; 42 | header += "package com.vgrs.xcode.util;\npublic class XcodeError {\n"; 43 | return header; 44 | } 45 | 46 | static public String getFooter() { 47 | return "}\n"; 48 | } 49 | 50 | static public void generate(File input, File output) { 51 | try { 52 | // Read from ErrorCodes.txt 53 | BufferedReader in = new BufferedReader(new FileReader(input)); 54 | Vector lines = new Vector(); 55 | String line = null; 56 | while ((line = in.readLine()) != null) { lines.add(line); } 57 | Iterator data = lines.iterator(); 58 | 59 | 60 | // Write to XcodeError.java 61 | FileOutputStream fos = new FileOutputStream(output); 62 | BufferedOutputStream bos = new BufferedOutputStream(fos); 63 | byte[] buffer; 64 | 65 | buffer = getHeader().getBytes(); 66 | bos.write(buffer,0,buffer.length); 67 | 68 | while (data.hasNext()) { 69 | buffer = generate((String)data.next()).getBytes(); 70 | bos.write(buffer,0,buffer.length); 71 | } 72 | 73 | buffer = getFooter().getBytes(); 74 | bos.write(buffer,0,buffer.length); 75 | 76 | bos.close(); 77 | } catch (Exception x) { x.printStackTrace(); } 78 | } 79 | 80 | static public String generate(String input) throws Exception { 81 | if (input == null) { return EMPTY; } 82 | input = input.trim(); 83 | if (input.length() == 0 || input.charAt(0) == '#') { return EMPTY; } 84 | 85 | int token; 86 | int code; 87 | String name; 88 | String msg; 89 | 90 | token = input.indexOf(DELIMITER); 91 | if (token < 0) {throw new Exception("Invalid file format: "+input);} 92 | code = Integer.parseInt(input.substring(0,token)); 93 | input = input.substring(token+1); 94 | 95 | token = input.indexOf(DELIMITER); 96 | if (token < 0) { 97 | name = input; 98 | msg = EMPTY; 99 | } else { 100 | name = input.substring(0,token); 101 | msg = input.substring(token+1); 102 | } 103 | 104 | String result = "\n\n/*\n * "+name+": "+code+"\n */\n"; 105 | 106 | // Create method with no parameters 107 | result += " static public XcodeException "+name+"() {\n"; 108 | result += " return new XcodeException(\n"; 109 | result += " "+code+",\n"; 110 | result += " \""+msg+"\"\n"; 111 | result += " );\n"; 112 | result += " }\n"; 113 | 114 | // Create method with String parameter 115 | result += " static public XcodeException "+name+"(String msg) {\n"; 116 | result += " return new XcodeException(\n"; 117 | result += " "+code+",\n"; 118 | result += " \""+msg+"\"+msg\n"; 119 | result += " );\n"; 120 | result += " }\n"; 121 | 122 | // Create is method with XcodeException parameter 123 | result += " static public boolean is_"+name+"(XcodeException x) {\n"; 124 | result += " return (x.getCode() == "+code+");\n"; 125 | result += " }\n"; 126 | 127 | return result; 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/util/XcodeException.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* XcodeException.java */ 4 | /* */ 5 | /* (c) VeriSign Inc., 2000-2003, All rights reserved */ 6 | /* */ 7 | /* @author: John Colosi */ 8 | /* @date: June, 2002 */ 9 | /* */ 10 | /*************************************************************************/ 11 | 12 | 13 | package com.vgrs.xcode.util; 14 | 15 | import java.util.*; 16 | 17 | /** 18 | * This object embodies all error conditions from the IDN SDK. 19 | */ 20 | 21 | public class XcodeException extends Exception { 22 | 23 | private int code; 24 | private String message; 25 | private Throwable parent; 26 | 27 | /** 28 | * Construct a xcode exception with an error code and detailed message 29 | * @param code an error code 30 | * @param message detailed message 31 | */ 32 | public XcodeException(int code, String message) { 33 | this(code,message,null); 34 | } 35 | 36 | /** 37 | * Construct a xcode exception chaining the supplied XcodeExcpetion and 38 | * another Throwable object. 39 | * @param x a XcodeException object 40 | * @param parent a Throwable object 41 | */ 42 | public XcodeException(XcodeException x, Throwable parent) { 43 | this(x.code,x.message,parent); 44 | } 45 | 46 | /** 47 | * Construct a xcode exception chaining the supplied XcodeExcpetion and 48 | * detail message. 49 | * @param x a XcodeException object 50 | * @param message detailed message 51 | */ 52 | public XcodeException(XcodeException x, String message) { 53 | this(x.code,x.message+message,x.parent); 54 | } 55 | 56 | /** 57 | * Construct a xcode exception with an error code, and chaining the 58 | * supplied XcodeExcpetion and a Throwable object 59 | * detail message. 60 | * @param x a XcodeException object 61 | * @param detailed message 62 | * @param parent a Throwable object 63 | */ 64 | public XcodeException(int code, String message, Throwable parent) { 65 | super(message); 66 | this.code = code; 67 | this.message = message; 68 | this.parent = parent; 69 | } 70 | 71 | /** 72 | * Obtain error code of this XcodeExcpetion 73 | * @return int error code 74 | */ 75 | public int getCode() { 76 | return this.code; 77 | } 78 | 79 | /** 80 | * Obtain detailed message of this XcodeExcpetion 81 | * @return String error message 82 | */ 83 | public String getMessage() { 84 | String output = new String(); 85 | if (this.message != null) {output += this.message;} 86 | if (this.parent != null) { 87 | output += "\n -> "+parent.getClass().getName()+": "; 88 | String msg = parent.getMessage(); 89 | if (msg != null) {output += msg;} 90 | } 91 | return output; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/api/java/com/vgrs/xcode/util/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Contains classes to access data source files, randomly generate test data, log debug info for unit test, and provides an exception class. 4 | 5 | 6 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/Ant - License.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * ============================================================================ 3 | * The Apache Software License, Version 1.1 4 | * ============================================================================ 5 | * 6 | * Copyright (C) 2000-2002 The Apache Software Foundation. All 7 | * rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modifica- 10 | * tion, are permitted provided that the following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 19 | * 3. The end-user documentation included with the redistribution, if any, must 20 | * include the following acknowledgment: "This product includes software 21 | * developed by the Apache Software Foundation (http://www.apache.org/)." 22 | * Alternately, this acknowledgment may appear in the software itself, if 23 | * and wherever such third-party acknowledgments normally appear. 24 | * 25 | * 4. The names "Ant" and "Apache Software Foundation" must not be used to 26 | * endorse or promote products derived from this software without prior 27 | * written permission. For written permission, please contact 28 | * apache@apache.org. 29 | * 30 | * 5. Products derived from this software may not be called "Apache", nor may 31 | * "Apache" appear in their name, without prior written permission of the 32 | * Apache Software Foundation. 33 | * 34 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, 35 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 36 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 37 | * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 38 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- 39 | * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 40 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 41 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 43 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | * 45 | * This software consists of voluntary contributions made by many individuals 46 | * on behalf of the Apache Software Foundation. For more information on the 47 | * Apache Software Foundation, please see . 48 | * 49 | */ 50 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/C Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/doc/C Readme.txt -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/IDNSDK - License.txt: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* VeriSign XCode (encode/decode) IDN Library */ 4 | /* */ 5 | /* A library for encoding / decoding of domain strings. */ 6 | /* */ 7 | /* (c) VeriSign Inc., 2003, All rights reserved */ 8 | /* */ 9 | /*************************************************************************/ 10 | 11 | /*************************************************************************/ 12 | /* */ 13 | /* Copyright (c) 2003, VeriSign Inc. */ 14 | /* All rights reserved. */ 15 | /* */ 16 | /* Redistribution and use in source and binary forms, with or */ 17 | /* without modification, are permitted provided that the following */ 18 | /* conditions are met: */ 19 | /* */ 20 | /* 1) Redistributions of source code must retain the above copyright */ 21 | /* notice, this list of conditions and the following disclaimer. */ 22 | /* */ 23 | /* 2) Redistributions in binary form must reproduce the above copyright */ 24 | /* notice, this list of conditions and the following disclaimer in */ 25 | /* the documentation and/or other materials provided with the */ 26 | /* distribution. */ 27 | /* */ 28 | /* 3) Neither the name of the VeriSign Inc. nor the names of its */ 29 | /* contributors may be used to endorse or promote products derived */ 30 | /* from this software without specific prior written permission. */ 31 | /* */ 32 | /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ 33 | /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ 34 | /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ 35 | /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */ 36 | /* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */ 37 | /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */ 38 | /* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS */ 39 | /* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED */ 40 | /* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */ 41 | /* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */ 42 | /* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ 43 | /* POSSIBILITY OF SUCH DAMAGE. */ 44 | /* */ 45 | /* This software is licensed under the BSD open source license. For more */ 46 | /* information visit www.opensource.org. */ 47 | /* */ 48 | /*************************************************************************/ 49 | 50 | /*************************************************************************/ 51 | /* */ 52 | /* Authors: */ 53 | /* */ 54 | /* John Colosi (VeriSign) */ 55 | /* Lihui Zhang (VeriSign) */ 56 | /* Srikanth Veeramachaneni (VeriSign) */ 57 | /* Jim Mathies (VeriSign) */ 58 | /* */ 59 | /*************************************************************************/ 60 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/IDNSDK - Programmer's Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/doc/IDNSDK - Programmer's Guide.pdf -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/IDNSDK - User's Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/doc/IDNSDK - User's Guide.pdf -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes 8 | 9 | 10 | 11 | 12 | 13 | All Classes 14 |
15 | 16 | 17 | 18 | 77 | 78 |
Ace 19 |
20 | Animation 21 |
22 | Base32 23 |
24 | Bidi 25 |
26 | Charmap 27 |
28 | Convert 29 |
30 | Converter 31 |
32 | Datafile 33 |
34 | DCE 35 |
36 | Debug 37 |
38 | EncodingVariants 39 |
40 | Hex 41 |
42 | Idna 43 |
44 | Nameprep 45 |
46 | Native 47 |
48 | Normalize 49 |
50 | Prohibit 51 |
52 | Punycode 53 |
54 | Race 55 |
56 | RandomData 57 |
58 | Unicode 59 |
60 | UnicodeFilter 61 |
62 | UnicodeMatrix 63 |
64 | UnicodeSequence 65 |
66 | UnicodeTokenizer 67 |
68 | Utf16 69 |
70 | Variation 71 |
72 | XcodeErrorGenerator 73 |
74 | XcodeException 75 |
76 |
79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/com/vgrs/xcode/common/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Internationalized Domain Name Software Development Kit API Specification Version 1.0: Package com.vgrs.xcode.common 8 | 9 | 10 | 11 | 12 | 13 | com.vgrs.xcode.common 14 | 15 | 16 | 39 | 40 |
17 | Classes  18 | 19 |
20 | Base32 21 |
22 | Hex 23 |
24 | Native 25 |
26 | Unicode 27 |
28 | UnicodeFilter 29 |
30 | UnicodeMatrix 31 |
32 | UnicodeSequence 33 |
34 | UnicodeTokenizer 35 |
36 | Utf16 37 |
38 | Variation
41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/com/vgrs/xcode/ext/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Internationalized Domain Name Software Development Kit API Specification Version 1.0: Package com.vgrs.xcode.ext 8 | 9 | 10 | 11 | 12 | 13 | com.vgrs.xcode.ext 14 | 15 | 16 | 25 | 26 |
17 | Classes  18 | 19 |
20 | Convert 21 |
22 | DCE 23 |
24 | EncodingVariants
27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/com/vgrs/xcode/idna/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Internationalized Domain Name Software Development Kit API Specification Version 1.0: Package com.vgrs.xcode.idna 8 | 9 | 10 | 11 | 12 | 13 | com.vgrs.xcode.idna 14 | 15 | 16 | 37 | 38 |
17 | Classes  18 | 19 |
20 | Ace 21 |
22 | Bidi 23 |
24 | Charmap 25 |
26 | Idna 27 |
28 | Nameprep 29 |
30 | Normalize 31 |
32 | Prohibit 33 |
34 | Punycode 35 |
36 | Race
39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/com/vgrs/xcode/jnlp/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Internationalized Domain Name Software Development Kit API Specification Version 1.0: Package com.vgrs.xcode.jnlp 8 | 9 | 10 | 11 | 12 | 13 | com.vgrs.xcode.jnlp 14 | 15 | 16 | 23 | 24 |
17 | Classes  18 | 19 |
20 | Animation 21 |
22 | Converter
25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/com/vgrs/xcode/util/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Internationalized Domain Name Software Development Kit API Specification Version 1.0: Package com.vgrs.xcode.util 8 | 9 | 10 | 11 | 12 | 13 | com.vgrs.xcode.util 14 | 15 | 16 | 27 | 28 |
17 | Classes  18 | 19 |
20 | Datafile 21 |
22 | Debug 23 |
24 | RandomData 25 |
26 | XcodeErrorGenerator
29 | 30 | 31 | 32 | 33 | 38 | 39 |
34 | Exceptions  35 | 36 |
37 | XcodeException
40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Internationalized Domain Name Software Development Kit API Specification Version 1.0 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | <H2> 19 | Frame Alert</H2> 20 | 21 | <P> 22 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 23 | <BR> 24 | Link to <A HREF="overview-summary.html">Non-frame version.</A> 25 | 26 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Internationalized Domain Name Software Development Kit API Specification Version 1.0: Overview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 |
16 |
19 | 20 | 21 | 22 | 38 | 39 |
All Classes 23 |

24 | 25 | Packages 26 |
27 | com.vgrs.xcode.common 28 |
29 | com.vgrs.xcode.ext 30 |
31 | com.vgrs.xcode.idna 32 |
33 | com.vgrs.xcode.jnlp 34 |
35 | com.vgrs.xcode.util 36 |
37 |

40 | 41 |

42 |   43 | 44 | 45 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/package-list: -------------------------------------------------------------------------------- 1 | com.vgrs.xcode.common 2 | com.vgrs.xcode.ext 3 | com.vgrs.xcode.idna 4 | com.vgrs.xcode.jnlp 5 | com.vgrs.xcode.util 6 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/packages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Internationalized Domain Name Software Development Kit API Specification Version 1.0 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |

19 | The front page has been relocated.Please see: 20 |
21 |           Frame version 22 |
23 |           Non-frame version.
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/doc/javadoc/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF } 7 | 8 | /* Table colors */ 9 | .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ 10 | .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ 11 | .TableRowColor { background: #FFFFFF } /* White */ 12 | 13 | /* Font used in left-hand frame lists */ 14 | .FrameTitleFont { font-size: normal; font-family: normal } 15 | .FrameHeadingFont { font-size: normal; font-family: normal } 16 | .FrameItemFont { font-size: normal; font-family: normal } 17 | 18 | /* Example of smaller, sans-serif font in frames */ 19 | /* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 29 | 30 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/lib/IDNSDK.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/lib/IDNSDK.jar -------------------------------------------------------------------------------- /IDNSDK-1.1.0/lib/ant-optional.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/lib/ant-optional.jar -------------------------------------------------------------------------------- /IDNSDK-1.1.0/lib/ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/lib/ant.jar -------------------------------------------------------------------------------- /IDNSDK-1.1.0/lib/jakarta-oro-2.0.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/lib/jakarta-oro-2.0.7.jar -------------------------------------------------------------------------------- /IDNSDK-1.1.0/lib/win32/xcode.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/lib/win32/xcode.dll -------------------------------------------------------------------------------- /IDNSDK-1.1.0/lib/win32/xcode.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/lib/win32/xcode.lib -------------------------------------------------------------------------------- /IDNSDK-1.1.0/lib/win32/xcodelib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/lib/win32/xcodelib.lib -------------------------------------------------------------------------------- /IDNSDK-1.1.0/lib/xerces.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/lib/xerces.jar -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/charmap.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/charmap.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/domains.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/domains.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/fullcircle.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/fullcircle.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/headerexport.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/headerexport.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/idna.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/idna.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/nameprep.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/nameprep.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/prohibit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/prohibit.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/punycode.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/punycode.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/race.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/race.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/unicode.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/unicode.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/c/win32/utf8.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigZaphod/IFUnicodeURL/b75c72b0f084000dfc7f3f9ac4747eb26ba7b9b5/IDNSDK-1.1.0/tools/c/win32/utf8.exe -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/base32: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.common.test.Base32Test $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/bidi: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.idna.test.BidiTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/charmap: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.idna.test.CharmapTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/convert: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.ext.test.ConvertTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/dce: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.ext.test.DCETest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/encvariants: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.ext.test.EncodingVariantsTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/gui: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.jnlp.Converter $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/hex: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.common.test.HexTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/idna: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.idna.test.IdnaTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/nameprep: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.idna.test.NameprepTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/native: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.common.test.NativeTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/normalize: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.idna.test.NormalizeTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/prohibit: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.idna.test.ProhibitTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/punycode: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.idna.test.PunycodeTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/race: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.idna.test.RaceTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/randomdata: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.util.RandomData $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/unix/unicode: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv CLASSPATH `dirname $0`/../../../lib/IDNSDK.jar 4 | java com.vgrs.xcode.common.test.UnicodeTest $* 5 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/base32.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.common.test.Base32Test %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/bidi.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.idna.test.BidiTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/charmap.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.idna.test.CharmapTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/convert.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.ext.test.ConvertTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/gui.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.jnlp.Converter %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/hex.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.common.test.HexTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/idna.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.idna.test.IdnaTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/nameprep.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.idna.test.NameprepTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/native.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.common.test.NativeTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/normalize.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.idna.test.NormalizeTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/prohibit.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.idna.test.ProhibitTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/punycode.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.idna.test.PunycodeTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/race.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.idna.test.RaceTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/randomdata.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.util.RandomData %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IDNSDK-1.1.0/tools/java/win32/unicode.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ---- check if JAVA_HOME is set ---- 4 | if "%JAVA_HOME%" == "" goto nojavahome 5 | 6 | set LIB_DIR=..\..\..\lib 7 | 8 | set MYCLASSPATH=%JAVA_HOME%\lib\tools.jar 9 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant-optional.jar 10 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\ant.jar 11 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\jakarta-oro-2.0.7.jar 12 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\xerces.jar 13 | set MYCLASSPATH=%MYCLASSPATH%;%LIB_DIR%\idnsdk.jar 14 | 15 | rem ---- invoke the java class ---- 16 | %JAVA_HOME%\bin\java -classpath %MYCLASSPATH% com.vgrs.xcode.common.test.UnicodeTest %* 17 | goto done 18 | 19 | :nojavahome 20 | echo ERROR: JAVA_HOME environment variable not set 21 | 22 | :done 23 | -------------------------------------------------------------------------------- /IFUnicodeURL-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2010 Iconfactory, Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are 4 | permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of 7 | conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list 10 | of conditions and the following disclaimer in the documentation and/or other materials 11 | provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY Iconfactory, Inc. ``AS IS'' AND ANY EXPRESS OR IMPLIED 14 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 15 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Iconfactory, Inc. OR 16 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 17 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 18 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 19 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 20 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 21 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | 23 | The views and conclusions contained in the software and documentation are those of the 24 | authors and should not be interpreted as representing official policies, either expressed 25 | or implied, of Iconfactory, Inc. -------------------------------------------------------------------------------- /IFUnicodeURL/IDNSDK/adapter.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* adapter */ 4 | /* */ 5 | /* Win32 Winsock replacement adapter for Race encoding. */ 6 | /* */ 7 | /* (c) Verisign Inc., 2000-2002, All rights reserved */ 8 | /* */ 9 | /*************************************************************************/ 10 | 11 | #ifndef _XCODE_WIN32_ADAPTER_H_ 12 | #define _XCODE_WIN32_ADAPTER_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" 16 | { 17 | #endif /* __cplusplus */ 18 | 19 | #ifdef WIN32 20 | #ifdef SUPPORT_RACE 21 | 22 | #pragma warning( disable : 4018 ) 23 | 24 | /* 25 | On Win32 platform, htons() is in the winsocks lib. 26 | To save a library load, we do it right here instead. 27 | */ 28 | 29 | #define INLINE_WORD_FLIP(out, in) \ 30 | { \ 31 | unsigned short int _in = (in); \ 32 | (out) = (_in << 8) | (_in >> 8);\ 33 | } 34 | 35 | #define INLINE_HTONS(out, in) INLINE_WORD_FLIP(out, in) 36 | 37 | #define INLINE_NTOHS(out, in) INLINE_WORD_FLIP(out, in) 38 | 39 | #define INLINE_DWORD_FLIP(out, in) \ 40 | { \ 41 | unsigned long int _in = (in); \ 42 | (out) = ((_in << 8) & 0x00ff0000) | \ 43 | (_in << 24) | \ 44 | ((_in >> 8) & 0x0000ff00) | \ 45 | (_in >> 24); \ 46 | } 47 | 48 | #define INLINE_NTOHL(out, in) INLINE_DWORD_FLIP(out, in) 49 | 50 | #define INLINE_HTONL(out, in) INLINE_DWORD_FLIP(out, in) 51 | 52 | static unsigned short int myhtons(unsigned short int in) 53 | { 54 | unsigned short int out; 55 | 56 | INLINE_WORD_FLIP(out,in); 57 | 58 | return out; 59 | } 60 | 61 | #endif 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif /* __cplusplus */ 67 | 68 | #endif /* _XCODE_WIN32_ADAPTER_H_ */ 69 | -------------------------------------------------------------------------------- /IFUnicodeURL/IDNSDK/staticdata/nameprep_data.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | /* */ 3 | /* static nameprep data lookup tables */ 4 | /* */ 5 | /* Struct definitions and data file includes for inline normalization. */ 6 | /* */ 7 | /* (c) Verisign Inc., 2000-2002, All rights reserved */ 8 | /* */ 9 | /*************************************************************************/ 10 | 11 | #ifndef __nameprep_static_h__ 12 | #define __nameprep_static_h__ 13 | 14 | #ifdef __cplusplus 15 | extern "C" 16 | { 17 | #endif /* __cplusplus */ 18 | 19 | /* lookup table data structure definitions */ 20 | 21 | #include "nameprep_datastructures.h" 22 | 23 | /* static data lookup tables */ 24 | 25 | #include "nameprep_compatible.h" 26 | #include "nameprep_cononical.h" 27 | #include "nameprep_compose.h" 28 | #include "nameprep_decompose.h" 29 | #include "nameprep_charmap.h" 30 | #include "nameprep_bidi_randalcat.h" 31 | #include "nameprep_bidi_lcat.h" 32 | #ifdef AllowUnassigned 33 | #include "nameprep_prohibit_allowunassigned.h" 34 | #else 35 | #include "nameprep_prohibit.h" 36 | #endif 37 | 38 | /* data table lookup routines */ 39 | 40 | #include "nameprep_lookups.h" 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif /* __cplusplus */ 45 | 46 | #endif /* __nameprep_static_h__ */ 47 | -------------------------------------------------------------------------------- /IFUnicodeURL/IDNSDK/staticdata/nameprep_datastructures.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************/ 2 | /* */ 3 | /* nameprep_datastructures.h */ 4 | /* */ 5 | /* Defines the data structures used by nameprep in the xcode library. The data */ 6 | /* headers are generated using the header export utility program. */ 7 | /* */ 8 | /* (c) Verisign Inc., 2000-2003, All rights reserved */ 9 | /* */ 10 | /*********************************************************************************/ 11 | 12 | #ifndef __nameprep_datastructures_h__ 13 | #define __nameprep_datastructures_h__ 14 | 15 | #ifdef __cplusplus 16 | extern "C" 17 | { 18 | #endif /* __cplusplus */ 19 | 20 | 21 | /* 22 | * 23 | * Prohibit data table: 24 | * 25 | * struct _ProhibitRangesTable 26 | * { 27 | * DWORD low; 28 | * DWORD high; 29 | * }; 30 | * typedef struct _ProhibitRangesTable ProhibitRangesTable; 31 | * 32 | * static ProhibitRangesTable g_prohibitTable[PROHIBIT_ENTRYCOUNT] = 33 | * { 34 | * { low, high }, 35 | * .. 36 | * } 37 | * 38 | * - 33 lines/ranges in the Prohibit data file 39 | * - low / high value for each 40 | * - single entries are in both high/low values 41 | * 42 | */ 43 | 44 | struct _ProhibitRangesTable 45 | { 46 | DWORD low; 47 | DWORD high; 48 | }; 49 | typedef struct _ProhibitRangesTable ProhibitRangesTable; 50 | typedef struct _ProhibitRangesTable LCatRangesTable; 51 | 52 | /* 53 | * 54 | * Character Map data table: 55 | * 56 | * Input data file example: 57 | * 58 | * character; (mapped to) char1 char2 char3...; Description 59 | * character; (mapped out) ; Description 60 | * 61 | * 1FFB; 1F7D; Case map 62 | * 1FFC; 03C9 03B9; Case map 63 | * 200D; ; Map to nothing 64 | * 20A8; 0072 0073; Additional folding 65 | * 2102; 0063; Additional folding 66 | * 2103; 00B0 0063; Additional folding 67 | * 68 | * Mapped characters range from 00 00AD to 01 D7BB. 69 | * 70 | * Output data structure: 71 | * 72 | * The data is stored in a lookup table. Nameprep uses a simple 73 | * binary search to find an entry or the lack of one. Expansion 74 | * character lists are either 3 characters, or 0/1/2 with a 75 | * terminating null character. 76 | * 77 | * const DWORD g_charmapTable[CHARMAP_ENTRYCOUNT][4] = { 78 | * { char, char1, char2, char3, char4 }, 79 | * { char, char1, char2, char3, char4 }, 80 | * } 81 | * 82 | */ 83 | 84 | struct _CharmapTable 85 | { 86 | DWORD dwCodepoint; 87 | short length; 88 | DWORD dwzData[4]; 89 | }; 90 | typedef struct _CharmapTable CharmapTable; 91 | 92 | 93 | /* 94 | * 95 | * Canonical Class data table 96 | * 97 | * Input data file example: 98 | * 99 | * Generated from the Unicode data file. 100 | * 101 | * Output data structure: 102 | * 103 | * Key value pairs. 104 | * 105 | * static CanonicalTable g_canonicalTable[CANONICAL_ENTRYCOUNT] = { 106 | * { cp 0x00000300, class 0x000000E6}, 107 | * } 108 | * 109 | */ 110 | 111 | typedef struct 112 | { 113 | DWORD dwCodepoint; 114 | DWORD dwClass; 115 | } CanonicalTable; 116 | 117 | 118 | /* 119 | * 120 | * Decomposition data table 121 | * 122 | * Input data file example: 123 | * 124 | * Generated from the Unicode data file. 125 | * 126 | * Output data structure: 127 | * 128 | * Codepoints which are decomposed in to a set of characters are listed in 129 | * sequetial order. dwCodepoint = codepoint, length = number of characters in the 130 | * decomposition string, dwzData = decomposition string terminated by null 131 | * character. 132 | * 133 | * static DecomposeTable g_decomposeTable[DECOMPOSE_ENTRYCOUNT] = { 134 | * { cp 0x000000BC, len 3, decomp {0x0031,0x2044,0x0034,0x0000} }, 135 | * } 136 | * 137 | */ 138 | 139 | typedef struct 140 | { 141 | DWORD dwCodepoint; 142 | short length; 143 | DWORD dwzData[20]; 144 | } DecomposeTable; 145 | 146 | /* 147 | * 148 | * Composition data table 149 | * 150 | * Input data file example: 151 | * 152 | * Generated from the Unicode data file. 153 | * 154 | * Output data structure: 155 | * 156 | * Codepoint pairs stored in 32 bit values and are listed in sequetial order. 157 | * 158 | * static ComposeTable g_composeTable[COMPOSE_ENTRYCOUNT] = { 159 | * { cp pair 0x0415000000000300, composed 0x00000400}, 160 | * } 161 | * 162 | */ 163 | 164 | typedef struct 165 | { 166 | QWORD qwPair; 167 | DWORD dwCodepoint; 168 | } ComposeTable; 169 | 170 | #ifdef __cplusplus 171 | } 172 | #endif /* __cplusplus */ 173 | 174 | #endif /* __nameprep_datastructures_h__ */ 175 | -------------------------------------------------------------------------------- /IFUnicodeURL/IDNSDK/staticdata/nameprep_prohibit_allowunassigned.h: -------------------------------------------------------------------------------- 1 | /********************************************************************/ 2 | /* Data Type : Prohibit Nameprep Range Table */ 3 | /* Version : 11 */ 4 | /* This file automatically generated by xcode header export utility */ 5 | /********************************************************************/ 6 | 7 | #define PROHIBIT_ENTRYCOUNT 33 8 | const ProhibitRangesTable g_prohibitTable[PROHIBIT_ENTRYCOUNT] = { 9 | { /* low */ 0x000080, /* high */ 0x0000A0 }, 10 | { /* low */ 0x000340, /* high */ 0x000341 }, 11 | { /* low */ 0x0006DD, /* high */ 0x0006DD }, 12 | { /* low */ 0x00070F, /* high */ 0x00070F }, 13 | { /* low */ 0x001680, /* high */ 0x001680 }, 14 | { /* low */ 0x00180E, /* high */ 0x00180E }, 15 | { /* low */ 0x002000, /* high */ 0x00200F }, 16 | { /* low */ 0x002028, /* high */ 0x00202F }, 17 | { /* low */ 0x00205F, /* high */ 0x002063 }, 18 | { /* low */ 0x00206A, /* high */ 0x00206F }, 19 | { /* low */ 0x002FF0, /* high */ 0x002FFB }, 20 | { /* low */ 0x003000, /* high */ 0x003000 }, 21 | { /* low */ 0x00D800, /* high */ 0x00F8FF }, 22 | { /* low */ 0x00FDD0, /* high */ 0x00FDEF }, 23 | { /* low */ 0x00FEFF, /* high */ 0x00FEFF }, 24 | { /* low */ 0x00FFF9, /* high */ 0x00FFFF }, 25 | { /* low */ 0x01D173, /* high */ 0x01D17A }, 26 | { /* low */ 0x01FFFE, /* high */ 0x01FFFF }, 27 | { /* low */ 0x02FFFE, /* high */ 0x02FFFF }, 28 | { /* low */ 0x03FFFE, /* high */ 0x03FFFF }, 29 | { /* low */ 0x04FFFE, /* high */ 0x04FFFF }, 30 | { /* low */ 0x05FFFE, /* high */ 0x05FFFF }, 31 | { /* low */ 0x06FFFE, /* high */ 0x06FFFF }, 32 | { /* low */ 0x07FFFE, /* high */ 0x07FFFF }, 33 | { /* low */ 0x08FFFE, /* high */ 0x08FFFF }, 34 | { /* low */ 0x09FFFE, /* high */ 0x09FFFF }, 35 | { /* low */ 0x0AFFFE, /* high */ 0x0AFFFF }, 36 | { /* low */ 0x0BFFFE, /* high */ 0x0BFFFF }, 37 | { /* low */ 0x0CFFFE, /* high */ 0x0CFFFF }, 38 | { /* low */ 0x0DFFFE, /* high */ 0x0DFFFF }, 39 | { /* low */ 0x0E0001, /* high */ 0x0E0001 }, 40 | { /* low */ 0x0E0020, /* high */ 0x0E007F }, 41 | { /* low */ 0x0EFFFE, /* high */ 0x10FFFF }, 42 | }; 43 | -------------------------------------------------------------------------------- /IFUnicodeURL/NSURL+IFUnicodeURL.h: -------------------------------------------------------------------------------- 1 | // Created by Sean Heber on 4/22/10. 2 | #import 3 | 4 | @interface NSURL (IFUnicodeURL) 5 | 6 | // These two take a normal NSString that may (or may not) contain a URL with a non-ASCII host name. 7 | // Normally NSURL doesn't work with these kinds of URLs (at least on iPhoneOS as of 3.2). 8 | // This will decode them according to the various RFCs into the ASCII host name and return a normal NSURL 9 | // object instance made with the converted host string in place of the unicode one. 10 | // NOTE: These methods also sanitize the path/query by decoding and re-encoding any percent escaped stuff. 11 | // NSURL doesn't normally do anything like that, but I found it handy to have. 12 | + (NSURL *)URLWithUnicodeString:(NSString *)str; 13 | - (id)initWithUnicodeString:(NSString *)str; 14 | 15 | // This will return the same thing as NSURL's absoluteString method, but it converts the domain back into 16 | // the unicode characters that a user would expect to see in a UI, etc. 17 | - (NSString *)unicodeAbsoluteString; 18 | 19 | // Returns the same as NSURL's host method, but will convert it back into the unicode characters if possible. 20 | - (NSString *)unicodeHost; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | IFUnicodeURL is a category for NSURL which will allow it to support [Internationalized domain names]() in URLs. 4 | 5 | # Usage 6 | 7 | Usage is quite simple. Where you'd have normally used NSURL's `URLWithString:` (or `initWithString:`) methods, simply use the unicode versions added by the category. There is also a method to retrieve the URL as a string with the hostname converted back into Unicode: 8 | 9 | NSURL *url = [NSURL URLWithUnicodeString:@"http://➡.ws/鞰齒"]; 10 | NSLog( @"The URL: %@", [url absoluteString] ); 11 | NSLog( @"The Unicode URL: %@", [url unicodeAbsoluteString] ); 12 | 13 | # Notes 14 | 15 | This uses code from IDN SDK from Verisign, Inc. The entire IDN SDK source package is included in IDNSDK-1.1.0/. I have pulled out and slightly modified (to avoid compiler and analyzer warnings) the files and headers needed so that building this in Xcode is as easy as adding the IFUnicodeURL folder to your project. 16 | 17 | Take note of the IDNSDK license which can be found in IDNSDK-1.1.0/doc. (The license is basically a BSD-like license.) The IFUnicodeURL category is licensed under the Simplified BSD License (see IFUnicodeURL-LICENSE.txt) 18 | 19 | # Author 20 | 21 | Sean Heber ([@BigZaphod](http://twitter.com/BigZaphod/) on Twitter) 22 | 23 | --------------------------------------------------------------------------------