summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2005-05-23 18:20:07 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2005-05-23 18:20:07 (GMT)
commit985af5617fe40c9a6e9a0083dc889e56a7add362 (patch)
treecc6bb4e196fd7502ad4f563793d370e322bea4d2 /src
parentedecc60b50455a42102cee189ccdac5c1bc2104e (diff)
downloadhdf5-985af5617fe40c9a6e9a0083dc889e56a7add362.zip
hdf5-985af5617fe40c9a6e9a0083dc889e56a7add362.tar.gz
hdf5-985af5617fe40c9a6e9a0083dc889e56a7add362.tar.bz2
[svn-r10785] Purpose:
Feature Description: Added "support" for UTF-8 character encoding. Solution: Wrote tests to check that UTF-8 can be used in a number of places in HDF5 (object names, data, etc.). These tests live in test/tunicode.c. Added a new UTF-8 character encoding for datatypes. Platforms tested: mir, modi4, heping Misc. update:
Diffstat (limited to 'src')
-rw-r--r--src/H5.c4
-rw-r--r--src/H5Tconv.c6
-rw-r--r--src/H5Tpublic.h4
3 files changed, 9 insertions, 5 deletions
diff --git a/src/H5.c b/src/H5.c
index 821ee3a..5956c9e 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -2687,7 +2687,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5T_CSET_ASCII:
fprintf (out, "H5T_CSET_ASCII");
break;
- case H5T_CSET_RESERVED_1:
+ case H5T_CSET_UTF8:
+ fprintf (out, "H5T_CSET_UTF8");
+ break;
case H5T_CSET_RESERVED_2:
case H5T_CSET_RESERVED_3:
case H5T_CSET_RESERVED_4:
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 5b4b4b7..d4125a1 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -3907,8 +3907,10 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad precision");
if (0 != src->shared->u.atomic.offset || 0 != dst->shared->u.atomic.offset)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad offset");
- if (H5T_CSET_ASCII != src->shared->u.atomic.u.s.cset || H5T_CSET_ASCII != dst->shared->u.atomic.u.s.cset)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character set");
+ if (H5T_CSET_ASCII != src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 != src->shared->u.atomic.u.s.cset)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad source character set");
+ if (H5T_CSET_ASCII != dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 != dst->shared->u.atomic.u.s.cset)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad destination character set");
if (src->shared->u.atomic.u.s.pad<0 || src->shared->u.atomic.u.s.pad>=H5T_NPAD ||
dst->shared->u.atomic.u.s.pad<0 || dst->shared->u.atomic.u.s.pad>=H5T_NPAD)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character padding");
diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h
index 98e92d3..8fe400a 100644
--- a/src/H5Tpublic.h
+++ b/src/H5Tpublic.h
@@ -78,7 +78,7 @@ typedef enum H5T_norm_t {
typedef enum H5T_cset_t {
H5T_CSET_ERROR = -1, /*error */
H5T_CSET_ASCII = 0, /*US ASCII */
- H5T_CSET_RESERVED_1 = 1, /*reserved for later use */
+ H5T_CSET_UTF8 = 1, /*UTF-8 Unicode encoding */
H5T_CSET_RESERVED_2 = 2, /*reserved for later use */
H5T_CSET_RESERVED_3 = 3, /*reserved for later use */
H5T_CSET_RESERVED_4 = 4, /*reserved for later use */
@@ -94,7 +94,7 @@ typedef enum H5T_cset_t {
H5T_CSET_RESERVED_14 = 14, /*reserved for later use */
H5T_CSET_RESERVED_15 = 15 /*reserved for later use */
} H5T_cset_t;
-#define H5T_NCSET H5T_CSET_RESERVED_1 /*Number of character sets actually defined */
+#define H5T_NCSET H5T_CSET_RESERVED_2 /*Number of character sets actually defined */
/*
* Type of padding to use in character strings. Do not change these values