timski72 Posted January 13, 2008 Share Posted January 13, 2008 Hello everyone. I want to write a script that will transcribe a Greek word into the Latin alphabet, so users who can't read the Greek alphabet will have some idea of how the word is pronounced. For example, a user might enter the Greek word "Καλημέρα" into a form, click on the "Transcribe" button and it will return "kalee mera". Putting it rather too simply, but so you understand what I'm trying to achieve, most sounds of the Greek alphabet map to a sound of the Latin alphabet. E.g. "β" sounds like "v" so I map accordingly. Π sounds like "p", "ξ" sounds like "kse" etc. I did this before in C# express, but when I tried to reproduce this script in PHP I came across a problem. I noticed that I was getting gibberish from the word entered in the form, i.e. in the $_POST['greek']. Php obviously doesn't like unicode. I had a look on the web and there is a lot of discussion about PHP not fully supporting PHP until version 6. Being a novice, I found some of the discussion a bit overwhelming, so before embarking on what might be an impossible mission, I thought I'd ask some advice first. So, first and foremost, is it possible, or am I wasting my time? Second, is anyone able to give me any pointers? My current host has PHP 5.25 running. I have tried adding the following to the html as one post did suggest this might solve the problem, at least I think that's what they were suggesting ;-) <meta http-equiv=”Content-Language” content=”bn”> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ > Any advice would be much appreciated :-) Cheers, Tim. Quote Link to comment https://forums.phpfreaks.com/topic/85800-solved-problem-with-greek-characters-in-php/ Share on other sites More sharing options...
dooper3 Posted January 14, 2008 Share Posted January 14, 2008 This is the article you should read... http://webcollab.sourceforge.net/unicode.html but if your host doesn't want to give you mbstring, then it won't work. Quote Link to comment https://forums.phpfreaks.com/topic/85800-solved-problem-with-greek-characters-in-php/#findComment-438779 Share on other sites More sharing options...
timski72 Posted January 14, 2008 Author Share Posted January 14, 2008 I've read that article through and it looks like that could resolve my issue. I'll implement the suggestions and, if successful, mark the post as resolved. Cheers, Tim. Quote Link to comment https://forums.phpfreaks.com/topic/85800-solved-problem-with-greek-characters-in-php/#findComment-438880 Share on other sites More sharing options...
timski72 Posted January 15, 2008 Author Share Posted January 15, 2008 Some of the suggestions in that article were useful. Also, I realised that I had file encoding set to ANSI in my PHP editor. Set this to UTF-8 and things seem to be working fine now. Quote Link to comment https://forums.phpfreaks.com/topic/85800-solved-problem-with-greek-characters-in-php/#findComment-440304 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.