• 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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

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

multiple excel sheet not working preoperly 2 Answers

Keeping object data in an excel sheet? 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges