Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Nik-Space · May 06, 2014 at 04:18 PM · databasecharactersexcelutf-8

Read XLS file with UTF-8 character;

I am using this script that is working. But in unity i can't get the strings from the shells. The are greek characters like "Κάλη μέρα" but i get "???? ????".

How i can get thisd work?

i try this but din;t change anything.

string con = "Driver={Microsoft Excel Driver (*.xls)};characterEncoding=UTF-8;CharSet=UTF-8;DriverId=790; Dbq="+filetoread+";";

the script i get it from : http://wiki.unity3d.com/index.php?title=Load_Data_from_Excel_2003

 void readXLS( string filetoread)
     {
         // Must be saved as excel 2003 workbook, not 2007, mono issue really
         string con = "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790; Dbq="+filetoread+";";
         Debug.Log(con);
         string yourQuery = "SELECT * FROM [Sheet1$]"; 
         // our odbc connector 
         OdbcConnection oCon = new OdbcConnection(con); 
         // our command object 
         OdbcCommand oCmd = new OdbcCommand(yourQuery, oCon);
         // table to hold the data 
         DataTable dtYourData = new DataTable("YourData"); 
         // open the connection 
         oCon.Open(); 
         // lets use a datareader to fill that table! 
         OdbcDataReader rData = oCmd.ExecuteReader(); 
         // now lets blast that into the table by sheer man power! 
         dtYourData.Load(rData); 
         // close that reader! 
         rData.Close(); 
         // close your connection to the spreadsheet! 
         oCon.Close(); 
         // wow look at us go now! we are on a roll!!!!! 
         // lets now see if our table has the spreadsheet data in it, shall we? 
  
         if(dtYourData.Rows.Count > 0) 
         { 
             // do something with the data here 
             // but how do I do this you ask??? good question! 
             for (int i = 0; i < dtYourData.Rows.Count; i++) 
             { 
                 // for giggles, lets see the column name then the data for that column! 
                 Debug.Log(dtYourData.Columns[0].ColumnName + " : " + dtYourData.Rows[i][dtYourData.Columns[0].ColumnName].ToString() + 
                     "  |  " + dtYourData.Columns[1].ColumnName + " : " + dtYourData.Rows[i][dtYourData.Columns[1].ColumnName].ToString() + 
                     "  |  " + dtYourData.Columns[2].ColumnName + " : " + dtYourData.Rows[i][dtYourData.Columns[2].ColumnName].ToString()); 
             } 
         } 
     }
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MyUnitydream · Jan 08, 2016 at 08:11 PM

hi.

uni-excel can create, read and edit excel files in unity3d https://www.assetstore.unity3d.com/en/#!/content/47540

support: arabic and persian language

by thanks

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 Nik-Space · Jan 08, 2016 at 09:15 PM 0
Share

Thanks man but the point was to do it my self...

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

21 People are following this question.

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

Related Questions

Local database on iOS 1 Answer

Good way to read/write .xlsx files 2 Answers

UTF-8 for foreign language characters on GUI 2 Answers

How to import data into Microsoft Excel? 1 Answer

Best tool to load data 1 Answer


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