Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, February 22, 2008 11:07:43 AM(UTC)

timh  
timh

Groups: Registered
Posts: 2


Hello, I am using .NET LeadTools v15 and am having issues trying to load a saved annotation XML that has unicode characters in the annotations text. The problem is that after the annotation is loaded, the text has incorrect characters in it.
<br /><br />
The code I am using is quite simple:
<br /><br />
AnnContainer anns = new AnnContainer();<br />
AnnCodecs annCodecs = new AnnCodecs();
<br /><br />
MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(annStr));
<br /><br />
annCodecs.Load(stream, anns, 1);
<br /><br />
I have saved the annotation xml string in a file which is attached to this message. <br /><br />
I can use the annCodecs.Load method to load the annotation file, and then the characters come out properly. But my application is not going to be reading files, it is going to be passed strings, and loading the string that is in the file is not working properly.
<br /><br />
As you can see, the resulting annotations text should be "錢莊吸血 月息15分榨乾唐雅君" but is actually coming out as "錢莊吸血 月息15分榨乾唐雅君".
<br /><br />
Any idea what could be wrong here?
<br /><br />
Thanks
File Attachment(s):
saved.zip (2kb) downloaded 20 time(s).
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Friday, February 22, 2008 1:34:23 PM(UTC)

timh  
timh

Groups: Registered
Posts: 2


I also want to note hear, you will need to have the Easy Asian Languages support installed to be able to see the Chineese characters in my annotation file.
 
#3 Posted : Sunday, February 24, 2008 5:51:43 AM(UTC)

Qasem Lubani  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 2 time(s) in 2 post(s)


I have tested the issue here and I was able to load your text correctly from stream.


Here is the code I used to load the ANN file:




FileStream FSstream = new FileStream(annFileName, System.IO.FileMode.Open);












Byte[] buffer = new Byte[FSstream.Length];
FSstream.Read(buffer, 0, (int)FSstream.Length);
FSstream.Close();
MemoryStream MSstream = new MemoryStream(buffer);
MSstream.Seek(0, SeekOrigin.Begin);
AnnCodecs.Load(MSstream, container, 1);




You will find attached also a
ZIP file that contains both the JPEG image and the ANN file I worked with and a screenshot of how the test was displayed at my end.




Can you please tell me the LEADTOOLS DLLs build number(Version info) that you are working with?

File Attachment(s):
Ann.zip (70kb) downloaded 21 time(s).
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.143 seconds.