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

  1. ===============================================================================
  2.                   Internationalization (I18N) For OS/2                 
  3. ===============================================================================
  4.  
  5.                 Copyright IBM Corporation -- 1993, 1994, 1995
  6.  
  7. DISCLAIMER: This package is not a full implementation of the X/Open XPG4 
  8. specification and does not make any claims of XPG4 branding. It implements 
  9. only the portions of the XPG4 specification which deal with 
  10. internationalization.
  11.  
  12. X/Open is a trademark of the X/Open Company Limited.
  13.  
  14. ===============================================================================
  15.  
  16.  
  17. /************************/
  18. /***     Contents     ***/
  19. /************************/
  20.  
  21. 1.  Overview
  22. 2.  Files in this directory
  23. 3.  How to run the sample program
  24. 4.  How to compile the sample program
  25. 5.  Notes
  26.  
  27. 1.  Overview
  28. ============
  29.  
  30. The sample program in this directory shows how to convert wide strings (and
  31. in one case, regular strings) to various numeric formats.  APIs are provided
  32. to convert wide strings to long integers, unsigned long integers, and doubles
  33. (floating point).  There is also a conversion routine to convert strings to
  34. doubles.
  35.  
  36. The reason that these APIs are culturally sensitive is that the radix character
  37. (what is called the "decimal point" in the US) is not always a period.  Certain
  38. locales (such as Fr_FR) use symbols such as a comma to separate numbers.
  39.  
  40. For example, the string: "123.45" could be converted to a floating point
  41. number if the assumption is made about the radix character.  In Fr_FR, however,
  42. the string shown is not a legal number.
  43.  
  44.  
  45.  
  46. 2.  Files in this directory
  47. ===========================
  48.  
  49. File            Purpose
  50. ------------------------------------------------------------------------------
  51. numconv.c       Source code for the numconv sample program.
  52. numconv.def     Definition file needed for compiling the program.
  53. numconv.mak     Make file used to compile the sample.
  54. numconv.exe     Compiled version of the numconv sample.
  55.  
  56. build.cmd       A command file which will compile and link the sample program.
  57. read.me         This file.
  58.  
  59.  
  60. 3.  How to run the sample program
  61. =================================
  62.  
  63. The following steps show 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.      3) Execute the numconv.exe program.
  73.  
  74.           Ex:   numconv
  75.  
  76.      4) Experiment with changing the values of the LANG environment
  77.         variable.  Try the Fr_FR locale to see the difference in the
  78.         results.  Observe that the numbers converted are not the same
  79.         based on the radix character.  Note: You should change
  80.         the codeset of OS/2 to 850 before running this program with
  81.         the french locale.  This can be done with the 'chcp' command:
  82.  
  83.           Ex: chcp 850
  84.  
  85.         When you are finished, change the codepage back to 437.
  86.  
  87.      5) Try to change the strings in the program to different radix
  88.         characters, and recompile.  Try on differing locales.
  89.  
  90.  
  91. 4.  How to compile the sample program
  92. =====================================
  93.  
  94. NOTE: The sample program is already compiled for you.  If you want to see the
  95.  behavior of the program, you can just run it.  The following instructions
  96.  are needed only if you want to modify the program and recompile it.
  97.  
  98. To compile the sample application:
  99.  
  100.      1) Make sure that the CSET/2 compiler and OS/2 toolkit are installed
  101.         correctly on your system.
  102.  
  103.      2) cd to the directory which contains the is source files.
  104.  
  105.      3) Type "build" at the command prompt.
  106.  
  107.  
  108. 5.  Notes
  109. =========
  110.  
  111. 1. Each of the APIs in this sample program produce an "end" string.  This
  112.    string contains all characters found after a legal number.  For example,
  113.    the string "123.4ghi" *is* converted to: 123.4 and the end string is: "ghi".
  114.  
  115. 2. The "strtod" function requires that the "stdlib" library be included, unlike
  116.    most of the I18N APIs.
  117.