Hi.

I have a problems with slovenian characters. I have a text file that has a
letters like č,š etc. I want data from that file to store in my database.

I tried utf8_encode and mb_convert_unicode but it doesn't work.

Anyone can help?

Recommended Answers

All 2 Replies

What is the encoding of your file? Files contain bytes of data, not characters. The bytes represent characters only according to whatever encoding was used to write the data to your file.

Ask whoever created your data file what encoding they used. Or, you could attach the file to your post here and we could try guessing the encoding. But the encoding is determined by the program that wrote data to the file and there is no completely reliable way to guess what the encoding is.

Member Avatar for nevvermind

1. mysql_connect()
2. mysql_select_db()
3. mysql_set_charset('utf8')

Also, your text file shoud be UTF-8 encoded (check settings in editor).
Your database should be utf_general_ci or something similar.
Your HTML should have <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
When using header() function, use header('Content-type: text/html; charset=utf-8')

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.