diacritics

Detecting words that start with an accented uppercase using regular expressions

回眸只為那壹抹淺笑 提交于 2020-01-11 09:44:09
问题 I want to extract the words that begin with a capital — including accented capitals — using regular expressions in Java. This is my conditional for words beginning with capital A through Z: if (link.text().matches("^[A-Z].+") == true) But I also want words that begin with an accented uppercase character, too. Do you have any ideas? 回答1: Start with http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html \p{javaUpperCase} Equivalent to java.lang.Character.isUpperCase() 回答2: To

Why does this code to replace accented chars with html codes fail to work?

China☆狼群 提交于 2020-01-07 06:58:25
问题 I want to replace accented chars (such as á, ñ, ¿, ¡, etc.) with the corresponding HTML codes (such as á, ñ, ¿, ¡, etc.). For example, this line of text: Imposible me ha sido rehusarme á las repetidas instancias que el Caballero Trelawney, el Doctor Livesey y otros muchos señores me ...should become: Imposible me ha sido rehusarme á las repetidas instancias que el Caballero Trelawney, el Doctor Livesey y otros muchos señores me This should be simple. I've got this code to make the attempt:

htaccess Mod_rewrite with accents

∥☆過路亽.° 提交于 2020-01-07 02:58:05
问题 I have an international website, and a section of the website, used to create a new person, has the person's name in the URL. I need that URL to allow accents as well as some special characters like à Right now I'm using: RewriteRule ^([áéíóúñÁÉÍÓÚÑäëïöüÄËÏÖÜçÇA-Za-z-]+)/?$ /newPerson.php?person=$1 [NC,QSA] UPDATE: This works, but is not a very elegant approach. I am asking for a better way of matching all letters (lower and uppercase) with all possible accents à, á, ä... etc, if there is

ucwords and french accented lettres encoding

Deadly 提交于 2020-01-03 13:34:16
问题 We have a database of Canadian addresses all in CAPS , the client requested that we transform to lower case expect the first letter and the letter after a '-' So i made this function , but I'm having problem with french accented letters . When having the file and charset as ISO-88591 It works fine , but when i try to make it UTF-8 it doesn't work anymore . Example of input : 'damien-claude élanger' output : Damien-Claude élanger the é in utf-8 will become � function cap_letter($string) {

ASP.NET MVC 3 jquery : French accent characters are showing as #233 characters on screen

时光总嘲笑我的痴心妄想 提交于 2020-01-03 08:09:29
问题 I have ASP.NET MVC 3 application having resource files in english and french . A text ' Sélectionner la pharmacie ' is stored in a french resource file. When the value is read from resource files with razor syntax, it shows ' S#233;lectionner la pharmacie ' instead of ' Sélectionner la pharmacie '. e.g. @MyResources.Strings_Resources.lbl_SelectPharmacy Is there a way I can make it show the french accent characters ? 回答1: I suspect that your text is already encoded and razor is trying to

Reading Text with Accent - Python

一笑奈何 提交于 2020-01-02 16:53:40
问题 I did some script in python that connects to GMAIL and print a email text... But, often my emails has words with "accent". And there is my problem... For example a text that I got: "PLANO DE S=C3=9ADE" should be printed as "PLANO DE SAÚDE". How can I turn legible my email text? What can I use to convert theses letters with accent? Thanks, The code suggested by Andrey, works fine on windows, but on Linux I still getting the wrong print: >>> b = 'PLANO DE S=C3=9ADE' >>> s = b.decode('quopri')

Reading Text with Accent - Python

半城伤御伤魂 提交于 2020-01-02 16:53:09
问题 I did some script in python that connects to GMAIL and print a email text... But, often my emails has words with "accent". And there is my problem... For example a text that I got: "PLANO DE S=C3=9ADE" should be printed as "PLANO DE SAÚDE". How can I turn legible my email text? What can I use to convert theses letters with accent? Thanks, The code suggested by Andrey, works fine on windows, but on Linux I still getting the wrong print: >>> b = 'PLANO DE S=C3=9ADE' >>> s = b.decode('quopri')

Mysql german accents not-sensitive search in full-text searches

大城市里の小女人 提交于 2020-01-02 07:38:33
问题 Let`s have a example hotels table: CREATE TABLE `hotels` ( `HotelNo` varchar(4) character set latin1 NOT NULL default '0000', `Hotel` varchar(80) character set latin1 NOT NULL default '', `City` varchar(100) character set latin1 default NULL, `CityFR` varchar(100) character set latin1 default NULL, `Region` varchar(50) character set latin1 default NULL, `RegionFR` varchar(100) character set latin1 default NULL, `Country` varchar(50) character set latin1 default NULL, `CountryFR` varchar(50)

How can I ignore accents when comparing strings in Perl?

纵饮孤独 提交于 2020-01-01 08:51:10
问题 I have this quiz application where I match what people type with the right answer. For now, what I do is basically that : if ($input =~ /$answer/i) { print "you won"; } It's nice, as if the answer is "fish" the user can type "a fish" and be counted a good answer. The problem I'm facing is that, well, my users as I are french, and I'd like to be able to accept, say, a user typing "taton", and the answer being "tâton". So, what I could do, is : use POSIX qw(locale_h); use locale; setlocale(LC

How can I ignore accents when comparing strings in Perl?

孤街醉人 提交于 2020-01-01 08:51:09
问题 I have this quiz application where I match what people type with the right answer. For now, what I do is basically that : if ($input =~ /$answer/i) { print "you won"; } It's nice, as if the answer is "fish" the user can type "a fish" and be counted a good answer. The problem I'm facing is that, well, my users as I are french, and I'd like to be able to accept, say, a user typing "taton", and the answer being "tâton". So, what I could do, is : use POSIX qw(locale_h); use locale; setlocale(LC