Git Product home page Git Product logo

Comments (7)

brtnfld avatar brtnfld commented on July 19, 2024

It is most likely a cgnsview issue (i.e., tcl/tk usage issue). hdfview is java based, so UTF-8 is natively handled.

from cgns.

qingfengxia avatar qingfengxia commented on July 19, 2024

typedef char char_33[33]; VTK IO seems transparents on UTF8,

https://github.com/Kitware/VTK/blob/master/IO/CGNS/vtkCGNSReaderInternal.h

it is likely paraview std::string ->QString translation has triggered some trouble, i will have a look.

from cgns.

brtnfld avatar brtnfld commented on July 19, 2024

How did you get utf-8 in CGNS? HDF5's default is ASCII, and the cgns library does not support changing it to utf-8. So if you are modifying the CGNS file to use utf-8, that is not supported.

from cgns.

qingfengxia avatar qingfengxia commented on July 19, 2024

I have cgns, then I use H5py to modified label string to asian language , treating cgns as hdf5. I can confirm asian string has been saved as H5T_CSET_UTF8 in cgns.

from cgns.

qingfengxia avatar qingfengxia commented on July 19, 2024
import h5py

filename = "./HeatingCoil_modified.h5.cgns"
f = h5py.File(filename, "a")  #  mode = 'a'

# hdf5 use utf8 as the string encoding?
grp = f["Base"]["FluidZone"]["Flow Solution"]
newkey = "Pressure压力".encode(encoding = 'UTF-8')
if newkey in grp:
	del grp[newkey]

if True:
    newdata = grp["Pressure"]  # shallow copy link?    copy.copy is not allowed, not pickleable
    newdata.attrs["name"] = "Pressure压力"   # auto encoding with utf8.  
    print(newdata.attrs["name"])

    grp[newkey] = newdata  # create new data with utf8 as H5group name

f.close()

from cgns.

MicK7 avatar MicK7 commented on July 19, 2024

The CGNS standard does not allow not ASCII names for nodes and it is not going to change soon.
Maybe you can try a CPEX to allow UTF-8 for strings stored in data container like DataArray_t. But for performance purpose UTF8 is not justified.

from cgns.

brtnfld avatar brtnfld commented on July 19, 2024

Closing since the CGNS standard does not support UTF-8.

A CPEX would have to be submitted to handle UTF-8 officially, and it would have to address performance issues that could arise from UTF-8.

from cgns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.