Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to create .csv files from an .xslx file. I am doing it manuall, by saving each tab as .csv. In one of the cells in a tab, there is a string 'InH₂O'. When I create .csv file for this tab, the above string is written in the csv file as 'InH?O'. How can I fix this? I would like to create a csv file having values which is in the xlsx file as it is. Appreciate any help.
Posted
Comments
Sergey Alexandrovich Kryukov 19-Jun-15 11:02am    
Platform? language? any other detail?
—SA

1 solution

It simply means that the H₂O was stored in the database as Unicode, using one of the UTFs (the subscript code point U+2082, "subscript two") and you wrote the Unicode string in one of the non-Unicode encodings, such as ASCII. The question mark you got is the usual "fallback" character used when the Unicode string is attempted serialize in some legacy encoding not supporting some of the characters of the character repertoire using in the original Unicode string.

The solution is to write output CSV file in one of the UTF encodings; usually the most practical for persistent storage UTF-8 is used. Further detail depends on your platform and language which you did not share with us. If you explain all the relevant detail, you could get further help, if you need it.

—SA
 
Share this answer
 
v2
Comments
George Swan 19-Jun-15 10:46am    
'which you did not bother to share with us.' I think that's a bit harsh, Sergey. Sumith may have just forgotten or perhaps he did not think it relevant.
Sergey Alexandrovich Kryukov 19-Jun-15 10:59am    
Maybe, but believe me, I don't have anything negative to the inquirer and agree with you.
Thank you for your advice. I've modified the text a bit.
—SA
George Swan 19-Jun-15 11:55am    
Thanks, Sergey. I am very appreciative of all the help you have given to posters on here over the years. Regards, George.
Sergey Alexandrovich Kryukov 19-Jun-15 12:06pm    
My pleasure, George. Thank you for your nice words.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900