|  | detect language |  | |
| | | Peter |  |
| Posted: Sat Aug 30, 2008 2:04 am Post subject: detect language |  |
Hello I have an UTF string, how can i detect what language it is? thanks from Peter (cmk128@hotmail.com) |
| |
| | | Captain Paralytic |  |
| Posted: Sat Aug 30, 2008 8:04 am Post subject: Re: detect language |  |
On 30 Aug, 05:04, Peter <cmk...@hotmail.com> wrote:
| Quote: | Hello I have an UTF string, how can i detect what language it is? thanks from Peter (cmk...@hotmail.com)
|
This is a difficult one since many words are the same in more than one language. You would also need a large pool of words with their language listed so that you could compare each word in your string with them and make a guess at the language.
The fact that the string is UTF has no real relavance to the language in which the string is written, unless it is one of the non-latin ones. |
| |
| | | AqD |  |
| Posted: Tue Sep 02, 2008 7:11 am Post subject: Re: detect language |  |
Peter wrote:
| Quote: | Hello I have an UTF string, how can i detect what language it is? thanks from Peter (cmk128@hotmail.com)
|
An UTF string can have characters of more than one languages. You can find out what lanaguages are used by scanning & checking every characters (see [mbstring] extension) and their codepages they're in. |
| |
| | | Gordon |  |
| Posted: Tue Sep 02, 2008 8:32 am Post subject: Re: detect language |  |
On Aug 30, 5:04 am, Peter <cmk...@hotmail.com> wrote:
| Quote: | Hello I have an UTF string, how can i detect what language it is? thanks from Peter (cmk...@hotmail.com)
|
You can't. Only a person reading it could tell for sure what language it is. If, however, you want to know the language a browser visiting your site is configured to use you could look at the Accept-Language header. |
| |
|
|