[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #JLS-704865]: Porting NETCDF 4.0 on OpenBSD 4.5 amd64



>>>>>>> *** Testing ncgen and ncdump for UTF8 support...
>>>>>>> *** creating classic offset file with utf8 characters...
>>>>>>> *** dump and compare utf8 output...
>>>>>>> Binary files utf8.cdl and ./ref_tst_utf8.cdl differ
>>>>>>> FAIL: run_utf8_tests.sh

> It looks like the problem may be in ncgen. Could you please run the
> following command from the ncdump directory and send (or make available
> for download) the file "utf8.nc" that results from running the command:
>
> ../ncgen/ncgen -b -o utf8.nc ref_tst_utf8.cdl

OK, thanks.  That verifies the problem is not in ncgen, but in ncdump.  I now
suspect that the way ncdump is printing UTF-8 encoded Unicode is being changed
by a locale setting, perhaps in a locale environment variable, such as
LC_CTYPE or by having run the localedef command in a shell startup file.

There are two ways to test whether this is really the problem.

  1.  Set your locale to "C" by setting the environment variable "LC_ALL" to
      "C", using either the setenv command (for csh or tcsh shell) or using the
      syntax

        export LC_ALL="C"

      if using sh, ksh.  Then in the ncdump directory, run "make clean check"
      and
      see if the failure still occurs.  This fix has the undesirable property
      of
      having to change your preferred locale just to run ncdump, so is just for
      testing if this is the problem.  After determining whether it makes
      things
      work, you can change back to your previous locale by logging out and in
      again.

  2.  Alternatively, insert the following 4 lines at the beginning of the
  "main"
      program in the file ncdump/ncdump.c:

#define EXIT_BADLOCALE 6
    if(setlocale(LC_ALL, "C") == NULL) { /* CDL ambiguous with non-"C" locales
    */
        return EXIT_BADLOCALE;
    }

      right after the

    boolean kind_out = false;   /* if true, just output kind of netCDF file */

    statement (around line 1958 in ncdump/ncdump.c).

    Then run "make clean check" and see if the problem is fixed.  If the
    problem
    goes away, this is the real fix we will use (perhaps with a feature test to
    make
    sure the setlocale() function exists on the target platform).

If you have trouble with either of these directions, please let me know!
I really appreciate your ability to run these tests on your OpenBSD system,
because
it saves us from having to get and install another testing platform.  I also
understand that it may be inconvenient to try either the 1. or 2. test right
away,
so please let me know if either of these fixes work, when you get time.

Thanks!

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: JLS-704865
Department: Support netCDF
Priority: Normal
Status: Closed