home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / i18nv102.zip / SAMPLE / COLLATE / READ.ME < prev   
Text File  |  1995-09-19  |  4KB  |  117 lines

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