diacritics

How to ignore acute accent in a javascript regex match?

荒凉一梦 提交于 2019-11-26 14:48:31
问题 I need to match a word like 'César' for a regex like this /^cesar/i . Is there an option like /i to configure the regex so it ignores the acute accents?. Or the only solution is to use a regex like this /^césar/i . 回答1: The standard ecmascript regex isn't ready for unicode (see http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode). So you have to use an external regex library. I used this one (with the unicode plugin) in the past : http://xregexp.com/ In your case, you may

How to convert letters with accents, umlauts, etc to their ASCII counterparts in Perl?

一曲冷凌霜 提交于 2019-11-26 14:23:26
问题 I'm writing a program that works with documents in Perl and a lot of the documents have characters such as ä, ö, ü, é, etc (both capital and lowercase). I'd like to replace them with ASCII counterparts a, o, u, e, etc . How would I do it in Perl? One of the solutions I thought of is to have a hash with keys being the umlaut and accent characters, and the values being ASCII counterparts, but that requires me to have a list of all umlaut and accent characters, which I don't have, and if I built

Accent insensitive search query in MySQL

主宰稳场 提交于 2019-11-26 14:14:22
问题 Is there any way to make search query accent insensitive? the column's and table's collation are utf8_polish_ci and I don't want to change them. example word : toruń select * from pages where title like '%torun%' It doesn't find "toruń". How can I do that? 回答1: You can change the collation at runtime in the sql query, ...where title like '%torun%' collate utf8_general_ci but beware that changing the collation on the fly at runtime forgoes the possibility of mysql using an index, so

Should I use accented characters in URLs?

早过忘川 提交于 2019-11-26 12:57:46
问题 When one creates web content in languages different than English the problem of search engine optimized and user friendly URLs emerge. I\'m wondering whether it is the best practice to use de-accented letters in URLs -- risking that some words have completely different meanings with and without certain accents -- or it is better to stick to the usage of non-english characters where appropriate sacrificing the readability of those URLs in less advanced environments (e.g. MSIE, view source). \

How to change diacritic characters to non-diacritic ones [duplicate]

本小妞迷上赌 提交于 2019-11-26 12:26:48
问题 This question already has an answer here: How do I remove diacritics (accents) from a string in .NET? 19 answers I\'ve found a answer how to remove diacritic characters on stackoverflow, but could you please tell me if it is possible to change diacritic characters to non-diacritic ones? Oh.. and I think about .NET (or other if not possible) 回答1: Copying from my own answer to another question: Instead of creating your own table, you could instead convert the text to normalization form D, where

How to handle diacritics (accents) when rewriting 'pretty URLs'

为君一笑 提交于 2019-11-26 11:17:02
问题 I rewrite URLs to include the title of user generated travelblogs. I do this for both readability of URLs and SEO purposes. http://www.example.com/gallery/280-Gorges_du_Todra/ The first integer is the id, the rest is for us humans (but is irrelevant for requesting the resource). Now people can write titles containing any UTF-8 character, but most are not allowed in the URL. My audience is generally English speaking, but since they travel, they like to include names like Aït Ben Haddou What is

Mongodb match accented characters as underlying character

三世轮回 提交于 2019-11-26 09:43:14
问题 In MongoDB \"db.foo.find()\" syntax, how can I tell it to match all letters and their accented versions? For example, if I have a list of names in my database: João François Jesús How would I allow a search for the strings \"Joao\", \"Francois\", or \"Jesus\" to match the given name? I am hoping that I don\'t have to do a search like this every time: db.names.find({name : /Fr[aã...][nñ][cç][all accented o characters][all accented i characters]s/ }) 回答1: As of Mongo 3.2, you can use $text and

How to remove diacritics from text?

和自甴很熟 提交于 2019-11-26 09:36:54
问题 I am making a swedish website, and swedish letters are å, ä, and ö. I need to make a string entered by a user to become url-safe with PHP. Basically, need to convert all characters to underscore, all EXCEPT these: A-Z, a-z, 1-9 and all swedish should be converted like this: \'å\' to \'a\' and \'ä\' to \'a\' and \'ö\' to \'o\' (just remove the dots above). The rest should become underscores as I said. Im not good at regular expressions so I would appreciate the help guys! Thanks NOTE: NOT

How to ignore accent in SQLite query (Android)

旧时模样 提交于 2019-11-26 08:46:30
I am new in Android and I'm working on a query in SQLite. My problem is that when I use accent in strings e.g. ÁÁÁ ááá ÀÀÀ ààà aaa AAA If I do: SELECT * FROM TB_MOVIE WHERE MOVIE_NAME LIKE '%a%' ORDER BY MOVIE_NAME; It's return: AAA aaa (It's ignoring the others) But if I do: SELECT * FROM TB_MOVIE WHERE MOVIE_NAME LIKE '%à%' ORDER BY MOVIE_NAME; It's return: ààà (ignoring the title "ÀÀÀ") I want to select strings in a SQLite DB without caring for the accents and the case. Please help. Generally, string comparisons in SQL are controlled by column or expression COLLATE rules. In Android, only

Check If the string contains accented characters in SQL?

泪湿孤枕 提交于 2019-11-26 08:36:54
问题 I want to perform a task if the input string contain any accented characters else do another task in SQL. Is there any way to check this condition in SQL ? Eg: @myString1 = \'àéêöhello!\' IF(@myString1 contains any accented characters) Task1 ELSE Task2 回答1: SQL Fiddle: http://sqlfiddle.com/#!6/9eecb7d/1607 declare @a nvarchar(32) = 'àéêöhello!' declare @b nvarchar(32) = 'aeeohello!' select case when (cast(@a as varchar(32)) collate SQL_Latin1_General_Cp1251_CS_AS) = @a then 0 else 1 end