diacritics

Stop OSX diacritics disabling KeyBindings in Java for all users?

て烟熏妆下的殇ゞ 提交于 2019-12-11 00:57:04
问题 (Note: I am aware of this question in which the user would have to enter a Terminal command to fix this issue, but I would prefer a solution in which the solution can be put into the application.) To explain, I am using KeyBindings in a Java application; however, if one holds a key like a, e, i, o, u, n, s, etc., the diacritic menu OSX uses somehow completely disables key input. It does not, however, affect mouse input if that is relevant. Here is some sample code in which the problem can be

Replace accents in string vector with Latex code

让人想犯罪 __ 提交于 2019-12-10 19:29:12
问题 Define: df <- data.frame(name=c("México","Michoacán"),dat=c(1,2)) s.t. > df name dat 1 México 1 2 Michoacán 2 When I print this table to a .tex file using xtable the accented characters get garbled, which is no surprise. I would like to replace accents with proper Latex formatting e.g.: > df name dat 1 M\'{e}xico 1 2 Michoac\'{a}n 2 Please note in real dataset there are many different names with different accented letters but all with same type of accent (i.e. foward-slash), so the only thing

Regex and accents/tildes

点点圈 提交于 2019-12-10 19:13:53
问题 How should I include accents into a regex? I'd like to detect letters from a-z and äáàëéèíìöóòúùñç but this regex doesn't work: $pattern = '/^([a-zäáàëéèíìöóòúùñç])/i'; 回答1: How about: cat test.php <?php preg_match('/\pL/u', 'é', $m); print_r($m); ?> php -q test.php Array ( [0] => é ) 回答2: You can try using a pre-defined class to match all letters, for instance: [\p{L}] This will work in most regex-engines. You can read more about unicode in regexes here, for instance: http://www.regular

Java how can I add an accented “e” to a string?

雨燕双飞 提交于 2019-12-10 17:21:14
问题 With the help of tucuxi from the existing post Java remove HTML from String without regular expressions I have built a method that will parse out any basic HTML tags from a string. Sometimes, however, the original string contains html hexadecimal characters like &#x00E9 (which is an accented e). I have started to add functionality which will translate these escaped characters into real characters. You're probably asking: Why not use regular expressions? Or a third party library? Unfortunately

Java - InetSocketAddress hostname with accents

浪尽此生 提交于 2019-12-10 13:07:49
问题 I encounter a problem establishing a connection with an server that has some accents (é è ô...) in its hostname. For example : String oUrl = "www.hôtel.fr"; System.out.println(oUrl); InetSocketAddress isa = new InetSocketAddress(oUrl.toString(), 80); System.out.println(isa.isUnresolved()); The ISA is never resolved. It works for www.google.fr. I tried to URLEncode the host (URLEncoder with UTF-8 charset, so hostname is www.h%C3%B4tel.fr) with no result. Does anybody have some clues ? I don't

remove umlauts or specialchars in javascript string

一笑奈何 提交于 2019-12-10 09:54:52
问题 Never played before with umlauts or specialchars in javascript strings. My problem is how to remove them? For example I have this in javascript: var oldstr = "Bayern München"; var str = oldstr.split(' ').join('-'); Result is Bayern-München ok easy, but now I want to remove the umlaut or specialchar like: Real Sporting de Gijón. How can I realize this? Kind regards, Frank 回答1: replace should be able to do it for you, e.g.: var str = str.replace(/ü/g, 'u'); ...of course ü and u are not the same

Erroneous email receiver display when using German umlauts and a comma in name

拜拜、爱过 提交于 2019-12-10 03:22:53
问题 Using the MailMessage class in .NET 4, I found an issue today that I'm unable to resolve so far. Please see the following code: using (var message = new MailMessage()) { message.From = new MailAddress(@"uwe.keim@gmail.com", "Uwe Keim"); message.Bcc.Add(new MailAddress(@"uk@zeta-software.de", "Uwe Keim")); // This fails (see screenshot). /*1*/ message.To.Add(new MailAddress(@"uk2@zeta-sw.net", "Müller, Fred")); // This succeeds. /*2*/ message.To.Add(new MailAddress(@"uk2@zeta-sw.net", "Fred

How can I do a accent insensitive search in Postgres 8.3.x with a DB in utf-8?

a 夏天 提交于 2019-12-09 18:22:02
问题 Tried select to_ascii('capo','LATIN1'), to_ascii('çapo','LATIN1') and the results are different.... 回答1: Look here. CREATE FUNCTION to_ascii(bytea, name) RETURNS text STRICT AS 'to_ascii_encname' LANGUAGE internal; and then just use it like this: SELECT to_ascii(convert_to('Übermeier', 'latin1'), 'latin1'); 来源: https://stackoverflow.com/questions/659076/how-can-i-do-a-accent-insensitive-search-in-postgres-8-3-x-with-a-db-in-utf-8

How to replace umlauts in a string?

大城市里の小女人 提交于 2019-12-09 13:11:45
问题 Is there any good library that performs conversation of umlauts and special characters to their "flat" representation? Eg: Ä -> AE Ü -> UE ß -> ss Anything you could advise? 回答1: use StringUtils , This is not the well-known apache library . That is solve your issue. replaceUmlauts public static java.lang.String replaceUmlauts(java.lang.String string) Replaces all umlauts in a string. Umlaut Replacement ä ae ö oe ü ue ß ss Parameters: string - String, where the umlauts has to be replaced

filemtime() [function.filemtime]: stat failed for filenames with umlauts

早过忘川 提交于 2019-12-09 08:51:07
问题 I use the PHP function filemtime to get the last modification time with PHP 5.3. This functions works very well but it seems to have some problems when the filenames have special characters (for example umlauts). If I run it on a filename with umlauts $stat = filemtime('C:/pictures/München.JPG'); then I get the output: Warning: filemtime() [function.filemtime]: stat failed for C:/pictures/München.JPG If I rename the file from "München.JPG" to "Muenchen.JPG" and do the same thing again: $stat