On Tue, 06 Oct 2009, Chen Kedem wrote:

Hi,

> After some checks:
> 1) The file is source/codepage/cpes850c.c (and not source/lang/...).
> 2) Current SVN version is besically the same version as originally
>     added to the repository.
> 3) I can't find in the dev list any remarks regarding its validity since
>     the day it was added.
> NOTE: I'm not a user of this Spanish codepage and have no idea how it is 
> implemented in Clipper. I'm just the guy who forward bug reports from SF to 
> this list.

Try the code below.
It generates characters strings which can be used to create CP definition
in Harbour. It's enough to compile this code using Clipper and then link
with given Clipper sort module (usually ntx*.obj) file and then execute.
If there is a problem with cpes850c.c then the upper and lower strings
will be different. If Spanish user can confirm it then we will update
cpes850c.c. Please only remember to attach information about exact version
of used sort modules. In some countries there were different sort modules
with the same CP name, i.e. distributed with CA-Clipper and with SIx3
library.

best regards,
Przemek

/*
 * cpinfo.prg
 */
proc main()
   local cLo, cUp, c, cl, cu, i, a

   set alternate to cpinfo.txt additive
   set alternate on

   a := array( 256 )
   for i := 1 to len( a )
      a[ i ] := i
   next
   asort( a,,, { |x,y| chr( x ) + chr( 0 ) < chr( y ) + chr( 0 ) } )

   ? date(), time(), os(), version()
   ? "Character encoding:"
   ? "==================="
   cLo := cUp := ""
   for i := 1 to len( a )
      c := chr( a[i] )
      if isalpha( c )
         cl := lower( c )
         cu := upper( c )
         cLo += cl
         cUp += cu
         if cl == cu
            ? "upper " + charval( cu ) + " and lower " + charval( cl ) + ;
              " equal"
         elseif !isalpha( cl )
            ? "wrongly defined character " + ;
              charval( c ) + ":" + charinfo( c ) + ;
              ", lower " + charval( cl ) + ":" + charinfo( cl )
         elseif !isalpha( cu )
            ? "wrongly defined character " + ;
              charval( c ) + ":" + charinfo( c ) + ;
              ", upper " + charval( cu ) + ":" + charinfo( cu )
         endif
      elseif islower( c ) .or. isupper( c )
         ? "wrongly defined character " + ;
           charval( c ) + ":" + charinfo( c )
      endif
   next
   ? 'upper: "' + cUp + '"'
   ? 'loerr: "' + cLo + '"'
   ? "==================="
   ?
return

static function charval( c )
return "'" + c + "' (" + ltrim( str( asc( c ) ) ) + ")"

static function charinfo( c )
   local cInfo
   cInfo :=   "ISALPHA->" + iif( isalpha( c ), "Y", "N" )
   cInfo += ", ISUPPER->" + iif( isupper( c ), "Y", "N" )
   cInfo += ", ISLOWER->" + iif( islower( c ), "Y", "N" )
return cInfo
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to