Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / September 2006

Tip: Looking for answers? Try searching our database.

String Serialization issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ukfreethinker@yahoo.com - 28 Sep 2006 22:38 GMT
Hello

Using Visual Studio, I created a WebService with the default
"HelloWorld" method.  It all works fine but when I try to get the
method to return a French string, all the accented characters are
removed.   ie. I changed the webservice implementation to:

<WebMethod()> _
   Public Function HelloWorld() As String
       Return "Hello décès"
   End Function

and when I invoke it on my server I get

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Hello dcs</string>

Can somebody tell me what is going wrong?

BTW, it works fine on my development machine but not on the production
server.

Paul
ukfreethinker@yahoo.com - 29 Sep 2006 11:49 GMT
> Hello
>
[quoted text clipped - 14 lines]
>
> Can somebody tell me what is going wrong?

OK, if anyone is interested, the answer is here:

http://www.aspnetresources.com/blog/unicode_in_vsnet.aspx

Visual Studio does not save your files as utf-8 by default and there
seems to be no way of changing the default.   You have to manually save
with encoding every time you save an .asmx or .vb file.   Surely this
is a bug or an oversight.

I still don't understand why it works on my local development machine
though.

Paul

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.