Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by diddykonga · Mar 24, 2012 at 10:59 PM · windowsxmlencoding

XMLSerializer Encoding Issue

While trying to load in a xml script, im getting this error in the output_log

 ArgumentException: Encoding name 'Windows-1252' not supported

 Parameter name: name
 at System.Text.Encoding.GetEncoding (System.String name) [0x00000] in <filename unknown>:0 

 at System.Xml.XmlInputStream.Initialize (System.IO.Stream stream) [0x00000] in <filename unknown>:0 

 at System.Xml.XmlInputStream..ctor (System.IO.Stream stream) [0x00000] in <filename unknown>:0 

 at (wrapper remoting-invoke-with-check) System.Xml.XmlInputStream:.ctor (System.IO.Stream)

 at System.Xml.XmlStreamReader..ctor (System.IO.Stream input) [0x00000] in <filename unknown>:0 

 at (wrapper remoting-invoke-with-check) System.Xml.XmlStreamReader:.ctor (System.IO.Stream)

 at System.Xml.XmlTextReader..ctor (System.IO.Stream input) [0x00000] in <filename unknown>:0 

 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.Stream stream) [0x00000] in <filename unknown>:0 

 at ComboManager.GetCombo (System.String _name) [0x0008d] in C:\Users\Admin\Desktop\Battle Brawl\Assets\Battle Assets\Scripts\Managers\ComboManager.cs:25 

 at Grenadier.Start () [0x00000] in C:\Users\Admin\Desktop\Battle Brawl\Assets\Battle Assets\Scripts\CharacterArchetypes\Grenadier.cs:7 
 
 (Filename: C Line: 0)

This is only happens when i build my game, and not in the editor.

Anybody know a fix?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by rutter · Mar 24, 2012 at 11:24 PM

This thread seems to have more information, and a potential workaround.

This next option isn't a sure bet, but you could try it: check your player settings, and if your API compatibility level is ".Net 2.0 subset", try bumping it up to ".Net 2.0". Doing so can increase the size of your built player, and unfortunately won't work on some of the more esoteric platforms, but it could provide a quick resolution.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image diddykonga · Mar 25, 2012 at 12:15 AM 1
Share

Thanks the answer in the link helped me out.

Just moved "I18N.dll" and "I18N-West.dll" into my managed folder for the build and it all worked fine, thanks :)

avatar image
8

Answer by lizardboy79 · Apr 07, 2015 at 09:38 PM

Hey all,

there is a much better solution than copying DLLs. When you do your serialization, make sure to use a Streamwriter with encoding set to "UTF-8" rather than a FileStream. Like this:

 var serializer = new XmlSerializer(typeof(SerializableClass));
  string filename = Application.dataPath + outputpath + outPutFileName;
  var encoding = Encoding.GetEncoding("UTF-8");
  
  using(StreamWriter stream = new StreamWriter( filename, false, encoding))
  {
      serializer.Serialize(stream, this);
  }

Cheers!

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BinaryBanana · Aug 30, 2015 at 07:39 AM 0
Share

Your answer solved my problem too. Thanks!

avatar image Sylker · Jan 27, 2017 at 08:44 PM 0
Share

Thanks a bunch! Simple and easy ;)

avatar image kofe · Feb 07, 2018 at 02:52 PM 0
Share

yep, that's work. thx

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Trying to XML serialize objects, getting error that UnityEngine.Transform doesn't implement Add() 1 Answer

Windows Application 2 Answers

A node in a childnode? 1 Answer

Is there any plugin for image tracking in windows ?Or does anyone knows how to do it in windows ? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges