character encoding - C#: Converting byte[] to UTF8 encoded string -


I am using a library to extract metadata information from images. In part, this liberalization is using system.Drawing.Imaging.PropertyItem to do all the hard work. Some data from the property itam, such as image descriptions, are brought as ASCII-String stored in bytes according to Microsoft's episode.

My problem is that the international character (å, ä, ö, et cetera) is skipped and replaced with questions when I debug the code so it is clear that byte [] One UTF-8 is represented.

I want to parse byte [] as a UTF 8-string, how can I do without any information in the process?

Thank you in advance!


Update:

I have been asked to provide a snippet with my code:

The first snippet The class used by, which is written by Asim Gohir, is written by xifestracker cs (property item.pro in system.Drawing.Imaging .pr) {string v = ""; // ... else if (p.Type == 0x2) {// string v = ascii.getstring (p.Value); }

And this is my code, where I do my best to conduct the above results.

  try {exifextractor exif = new exifextractor (ref bmp), ""); Object o; If ((o = xf ["image description"])! = Null media file. Description = tools.utf 8 encode (o.toostring ());  

I have also tried several other ways which are getting from data from my precious, ä, ö, but nothing seems to be that this is a trick. I'm thinking that Hans Paceint is right about his findings in his reply given below.

  string yourText = System.Text.Encoding.UTF8.GetString (yourByteArray);  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -