English 中文(简体)
• 如何编码集中的果园
原标题:How to encode accented char

I am using php and getting some utf8 string from Javascript.

I try to remove accent... by using a lot of difference function but still have troubles... With iconv() I have wrong accent removing, with some encode() I have nothing...

When I use serialize(mystring), my wrong char look like followings: xE3xA0 with A0 depending of the char.

It there any exhaustive map I can use ? Is there another method ?

(我处于第5.2号,对服务器没有实际控制,因此我无法使用tl/Normalize)


Edit : code like this doesnt works (otherwise it would be ugly but efficient for short term)

 $string = mb_ereg_replace( (À|Á|Â|Ã|Ä|Å|à|á|â|ã|ä|å) , a ,$string);
最佳回答

应:

iconv("UTF-8", "ASCII//TRANSLIT", $text)

如果做不到,请见“。 • 如何从植物检疫的特性中删除疫苗?

问题回答




相关问题
How does gettext handle dynamic content?

In php (or maybe gettext in general), what does gettext do when it sees a variable to dynamic content? I have 2 cases in mind. 1) Let s say I have <?=$user1?> poked John <?=$user2?>. ...

Explain the Need for Mutexes in Locales, Please

Reading the question Why doesn’t C++ STL support atoi(const string& ) like functions?, I encountered a comment which warned that GCC (at least) has a bug that can slow down multi-threaded ...

How does Vistalizer work

How does Vistalizer manage to override the language limit in Windows Vista Home edition. Which api s does it use to allow installation of Multiple language packages.

Localized exceptions (within a Struts2 app)

I am developing a Struts 2 application with support for multiple languages. If one of the domain objects needs to throw an exception, how can it do so in such a way that the error message is no ...

Rails Globalize plugin help

Has anyone gotten the Globalize plugin to work Rails 2.3.2 or later? If so, could you direct me to some useful info?

热门标签