in

ASP.NET Weblogs

Jason Nadal

Restless C#ding

Translation Bug Solved

After way too much time away, I have finally gotten around to refactoring my free translation web service, after a move to a new host (more on that later).

The service, which has been housed at:

http://www.restlessdelusions.com/projects/services/translate/translate.asmx

has had a bug with certain characters for quite a while.  An English to Spanish translation of "This is mine." resulted in the garbled "?ste es el m?o", due to some encoding error I never had the time to fix. Well here's the answer:  you can encode a StreamReader with a codepage based on the client's machine. To solve the problem, I created an enum based on microsoft's typography docs and created an overload which defaulted to Latin2 (Codepage 1250). There's also an overload if anyone using the service wants to choose a custom codepage.

You can try out the service via the asmx above, or use my Winform Sample

Enjoy!

Comments

 

Claire said:

I've been trying to use this webservice, in both my own app and your sample.

It returns that it has completed but nothing happens! what's going on???

August 7, 2007 5:55 AM

Leave a Comment

(required)  
(optional)
(required)  
Add