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 And this is my code, where I do my best to conduct the above results. 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.
try {exifextractor exif = new exifextractor (ref bmp), ""); Object o; If ((o = xf ["image description"])! = Null media file. Description = tools.utf 8 encode (o.toostring ());
string yourText = System.Text.Encoding.UTF8.GetString (yourByteArray);
Comments
Post a Comment