home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / i18nv104.zip / SAMPLE / COLLATE / READ.ME < prev   
Text File  |  1996-02-13  |  4KB  |  114 lines

  1.  
  2. ===============================================================================
  3.                   Internationalization (I18N) For OS/2                 
  4. ===============================================================================
  5.  
  6.                 Copyright IBM Corporation -- 1993, 1994, 1995
  7.  
  8. DISCLAIMER: This package is not a full implementation of the X/Open XPG4 
  9. specification and does not make any claims of XPG4 branding. It implements 
  10. only the portions of the XPG4 specification which deal with 
  11. internationalization.
  12.  
  13. X/Open is a trademark of the X/Open Company Limited.
  14.  
  15. ===============================================================================
  16.  
  17.  
  18. /************************/
  19. /***     Contents     ***/
  20. /************************/
  21.  
  22. 1.  Overview
  23. 2.  Files in this directory
  24. 3.  How to run the sample program
  25. 4.  How to compile the sample program
  26.  
  27.  
  28. 1.  Overview
  29. ============
  30.  
  31. The sample program in this directory demonstrates the use of culturally-based
  32. collation.  Collation MUST be culturally-based, or your data will be sorted
  33. in the wrong order for the users of the program.  Using a traditional English
  34. (ASCII) based collation will result in incorrect data for many reasons,
  35. including the fact that english has no accent marks, many other languages do
  36. not have capital letters, and multi-byte characters (such as in Ja_JP locale)
  37. have their own sort order.
  38.  
  39. Thus, using the simple "strcmp" routine is insufficient for sorting.  
  40. The XPG4 model provides collation functions for both char and wchar_t data 
  41. types.
  42.  
  43.  
  44. 2.  Files in this directory
  45. ===========================
  46.  
  47. File            Purpose
  48. ------------------------------------------------------------------------------
  49. collate.c       Source code for the collate sample program.
  50. collate.def     Definition file needed for compiling the program.
  51. collate.mak     Make file used to compile the sample.
  52. collate.exe     Compiled version of the collate sample.
  53.  
  54. build.cmd       A command file which will compile and link the sample program.
  55. read.me         This file.
  56.  
  57.  
  58. 3.  How to run the sample program
  59. =================================
  60.  
  61. This sample program shows how one can perform culturally-based collation and
  62. comparisons, for both char and wchar_t data types.  The following steps show
  63. how the program can be run.
  64.  
  65.      1) Run the \i18n\bin\new_vars command file (or have the environment
  66.         variables already set).
  67.  
  68.      2) Set the value of either LC_ALL or LANG to: En_US (US English).
  69.  
  70.           Ex:   set LANG=En_US
  71.  
  72.      4) Execute the collate.exe program.
  73.  
  74.           Ex:   collate
  75.  
  76.      5) The output from the program should be:
  77.  
  78. Locale setting: ENUS437
  79.  
  80. Functions with multibyte strings:
  81. ---------------------------------
  82. Initial array: côte côté coté cote 
  83. After sorting: cote coté côte côté 
  84.  
  85. strxfrm on string: 'côté' is: 0x63937482
  86. Functions with wide strings:
  87. ----------------------------
  88. Two strings are: 'hello' and 'Hello'
  89. Collation on those two strings is: 1
  90.  
  91. wcsxfrm on string: 'hello' is 0x: 6a0167016e016e0171010101
  92.  
  93.      6) Experiment with changing the values of the LANG environment
  94.         variable.  Try the Fr_FR.IBM-850 locale to see the difference in the
  95.         wide character collation results.  Try the Ja_JP.IBM-932 locale to see 
  96.         a difference in the string sort order.
  97.  
  98.  
  99. 4.  How to compile the sample program
  100. =====================================
  101.  
  102. NOTE: The sample program is already compiled for you.  If you want to see the
  103.  behavior of the program, you can just run it.  The following instructions
  104.  are needed only if you want to modify the program and recompile it.
  105.  
  106. To compile the sample application:
  107.  
  108.      1) Make sure that the CSET/2 compiler and OS/2 toolkit are installed
  109.         correctly on your system.
  110.  
  111.      2) cd to the directory which contains the collate source files.
  112.  
  113.      3) Type "build" at the command prompt.
  114.