dcmjs-org / dcmjs

Javascript implementation of DICOM manipulation
https://dcmjs.netlify.com/
MIT License
291 stars 110 forks source link

ReadBufferStream not support latine 1 on Mobile #297

Open ledinhthi opened 2 years ago

ledinhthi commented 2 years ago

Today, i got problem about this function ReadBufferStream, but when i run , i got this The "latin1" encoding is not supported, please help me to solve this

ledinhthi commented 2 years ago

@richard-viney please help me

ledinhthi commented 2 years ago

@richard-viney do we have any example for conver pdf, image to dcm and send, thank you so much

richard-viney commented 2 years ago

I happened to run into a character set issue last week which is now fixed in this PR: #299. This change might address your problem, but without providing a failing test case it's hard to say.

If you're interested in understanding how DICOM handles image data this article might be of interest: http://dicomiseasy.blogspot.com/2012/08/chapter-12-pixel-data.html

ledinhthi commented 2 years ago

Hi @richard-viney Do you have any example about the convert pdf (image) to dcm, i would be appreciated that. Thank you so much!!

richard-viney commented 2 years ago

Sorry no I haven't worked with PDF data in DICOM files yet. There are likely some resources around on how it works though.

niraj22384 commented 1 year ago

Hi ledinhthi

Seems post 0.24.7 version of library, BufferStream.js was modified to use default textdecoding to 'latin1' and which is not supported on Mobile. Previous version of library (0.24.7 and below) its working.

Try changing new TextDecoder("latin1"); present in BufferStream.js to new TextDecoder("utf-8"); see if resolves the issues.

Thanks