Search Results

Search found 80 results on 4 pages for 'accents'.

Page 1/4 | 1 2 3 4  | Next Page >

  • Remove accents from String .NET

    - by developerit
    Private Const ACCENT As String = “ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÌÍÎÏìíîïÙÚÛÜùúûüÿÑñÇç” Private Const SANSACCENT As String = “AAAAAAaaaaaaOOOOOOooooooEEEEeeeeIIIIiiiiUUUUuuuuyNnCc” Public Shared Function FormatForUrl(ByVal uriBase As String) As String If String.IsNullOrEmpty(uriBase) Then Return uriBase End If ‘// Declaration de variables Dim chaine As String = uriBase.Trim.Replace(” “, “-”) chaine = chaine.Replace(” “c, “-”c) chaine = chaine.Replace(“–”, “-”) chaine = chaine.Replace(“‘”c, String.Empty) chaine = chaine.Replace(“?”c, String.Empty) chaine = chaine.Replace(“#”c, String.Empty) chaine = chaine.Replace(“:”c, String.Empty) chaine = chaine.Replace(“;”c, String.Empty) ‘// Conversion des chaines en tableaux de caractŠres Dim tableauSansAccent As Char() = SANSACCENT.ToCharArray Dim tableauAccent As Char() = ACCENT.ToCharArray ‘// Pour chaque accent For i As Integer = 0 To ACCENT.Length – 1 ‘ // Remplacement de l’accent par son ‚quivalent sans accent dans la chaŒne de caractŠres chaine = chaine.Replace(tableauAccent(i).ToString(), tableauSansAccent(i).ToString()) Next ‘// Retour du resultat Return chaine End Function

    Read the article

  • (HARD)Remove accents from a JSON response using the raw content

    - by Pentium10
    This is a follow up of this question: Remove accents from a JSON response. The accepted answer there works for a single item/string of a raw JSON content. But I would like to run a full transformation over the entire raw content of the JSON without parsing each object/array/item. What I've tried is this function removeAccents($jsoncontent) { $obj=json_decode($jsoncontent); // use decode to transform the unicode chars to utf $content=serialize($obj); // serialize into string, so the whole obj structure can be used string as a whole $a = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿRr'; $b = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr'; $content=utf8_decode($content); $jsoncontent = strtr($content, $a, $b); // at this point the accents are removed, and everything is good echo $jsoncontent; $obj=unserialize($jsoncontent); // this unserialization is returning false, probably because we messed up with the serialized string return json_encode($obj); } As you see after I decoded JSON content, I serialized the object to have a string of it, than I remove the accents from that string, but this way I have problem building back the object, as the unserialize stuff returns false. How can I fix this?

    Read the article

  • Accents in uploaded file being replaced with '?'

    - by Katfish
    I am building a data import tool for the admin section of a website I am working on. The data is in both French and English, and contains many accented characters. Whenever I attempt to upload a file, parse the data, and store it in my MySQL database, the accents are replaced with '?'. I have text files containing data (charset is iso-8859-1) which I upload to my server using CodeIgniter's file upload library. I then read the file in PHP. My code is similar to this: $this->upload->do_upload() $data = array('upload_data' => $this->upload->data()); $fileHandle = fopen($data['upload_data']['full_path'], "r"); while (($line = fgets($fileHandle)) !== false) { echo $line; } This produces lines with accents replaced with '?'. Everything else is correct. If I download my uploaded file from my server over FTP, the charset is still iso-8850-1, but a diff reveals that the file has changed. However, if I open the file in TextEdit, it displays properly. I attempted to use PHP's stream_encoding method to explicitly set my file stream to iso-8859-1, but my build of PHP does not have the method. After running out of ideas, I tried wrapping my strings in both utf8_encode and utf8_decode. Neither worked. If anyone has any suggestions about things I could try, I would be extremely grateful.

    Read the article

  • Accents in file name using Java on Solaris

    - by Stef
    I have a problem where I can't write files with accents in the file name on Solaris. Given following code public static void main(String[] args) { System.out.println("Charset = "+ Charset.defaultCharset().toString()); System.out.println("testéörtkuoë"); FileWriter fw = null; try { fw = new FileWriter("testéörtkuoë"); fw.write("testéörtkuoëéörtkuoë"); fw.close(); I get following output Charset = ISO-8859-1 test??rtkuo? and I get a file called "test??rtkuo?" Based on info I found on StackOverflow, I tried to call the Java app by adding "-Dfile.encoding=UTF-8" at startup. This returns following output Charset = UTF-8 testéörtkuoë But the filename is still "test??rtkuo?" Any help is much appreciated. Stef

    Read the article

  • FTP server output and accents

    - by James P.
    I've written this little test class to connect up to an FTP server. import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; public class FTPTest { public static void main(String[] args) { URL url = null; try { url = new URL("ftp://anonymous:[email protected]"); } catch (MalformedURLException e) { e.printStackTrace(); } URLConnection conn = null; try { conn = url.openConnection(); } catch (IOException e) { e.printStackTrace(); } InputStream in = null; try { in = conn.getInputStream(); } catch (IOException e) { e.printStackTrace(); } BufferedInputStream bin = new BufferedInputStream(in); int b; try { while ((b = bin.read()) != -1) { char c = (char) b; System.out.print("" + (char) b); } } catch (IOException e) { e.printStackTrace(); } } } Here's the output: -rw-r--r-- 1 ftp ftp 4700 Apr 30 2007 premier.java -rw-r--r-- 1 ftp ftp 88576 Oct 23 2007 Serie1_1.doc -rw-r--r-- 1 ftp ftp 1401 Nov 21 2006 tp20061121.txt drwxr-xr-x 1 ftp ftp 0 Apr 23 20:04 répertoire Notice the name of the directory at the end of the list. There should be an "é" (e with acute accent) instead of the double character "é". This reminds me of an issue encountered previously with JSF where there was a mix-up between standards. I have little experience with character-encoding though so I'm not sure what's happening. I'm supposing that the server output is in ASCII so how do I adapt the output so it appears correctly in the console?

    Read the article

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

    - by lukaszsadowski
    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) character set latin1 default NULL, `HotelText` text character set latin1, `HotelTextFR` text character set latin1, `tagsforsearch` text character set latin1, `tagsforsearchFR` text character set latin1, PRIMARY KEY (`HotelNo`), FULLTEXT KEY `fulltextHotelSearch` (`HotelNo`,`Hotel`,`City`,`CityFR`,`Region`,`RegionFR`,`Country`,`CountryFR`,`HotelText`,`HotelTextFR`,`tagsforsearch`,`tagsforsearchFR`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci; In this table for example we have only one hotel with Region name = "Graubünden" (please note umlaut ü character) And now I want to achieve same search match for phrases: 'graubunden' and 'graubünden' This is simple with use of MySql built in collations in regular searches as follows: SELECT * FROM `hotels` WHERE `Region` LIKE CONVERT(_utf8 '%graubunden%' USING latin1) COLLATE latin1_german1_ci This works fine for 'graubunden' and 'graubünden' and as a result I receive proper result, but problem is when we make MySQL full text search Whats wrong with this SQL statement?: SELECT * FROM hotels WHERE MATCH (`HotelNo`,`Hotel`,`Address`,`City`,`CityFR`,`Region`,`RegionFR`,`Country`,`CountryFR`, `HotelText`, `HotelTextFR`, `tagsforsearch`, `tagsforsearchFR`) AGAINST( CONVERT('+graubunden' USING latin1) COLLATE latin1_german1_ci IN BOOLEAN MODE) ORDER BY Country ASC, Region ASC, City ASC This doesn`t return any result. Any ideas where the dog is buried ?

    Read the article

  • Remove accents from a JSON response using the raw content.

    - by Pentium10
    This is a follow up of this question: Remove accents from a JSON response. The accepted answer there works for a single item/string of a raw JSON content. But I would like to run a full transformation over the entire raw content of the JSON without parsing each object/array/item. What I've tried is this function removeAccents($jsoncontent) { $obj=json_decode($jsoncontent); // use decode to transform the unicode chars to utf $content=serialize($obj); // serialize into string, so the whole obj structure can be used string as a whole $a = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿRr'; $b = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr'; $content=utf8_decode($content); $jsoncontent = strtr($content, $a, $b); // at this point the accents are removed, and everything is good echo $jsoncontent; $obj=unserialize($jsoncontent); // this unserialization is returning false, probably because we messed up with the serialized string return json_encode($obj); } As you see after I decoded JSON content, I serialized the object to have a string of it, than I remove the accents from that string, but this way I have problem building back the object, as the unserialize stuff returns false. How can I fix this?

    Read the article

  • What is the best way to remove accents in a python unicode string?

    - by MiniQuark
    I have a unicode string in python, and I would like to remove all the accents (diacritics). I found on the Web an elegant way to do this in Java: convert the unicode string to its long normalized form (with a separate character for letters and diacritics) remove all the characters whose unicode type is "diacritic". Do I need to install a library such as pyICU or is this possible with just the python standard library? And what about in python 3.0? Important note: I would like to avoid code with an explicit mapping from accented characters to their non-accented counterpart. Thanks for your help.

    Read the article

  • French accents on a PC with US keyboard??

    - by frenchie
    My laptop has a US keyboard, and I need to write some French, with accents. I know there's a painful way to do it with combinations of the alt key and the ascii code alt-codes, but I was wondering if there was an easier way to do it. PS: Since the question is closed (but the answers no great) I thought I'd add this addendum. Basically, you need to set the keyboard to US International and then you can do accents using 'e or 'a; see this link: http://support.microsoft.com/kb/97738 PS: Much much better solution: http://keyxpat.com.

    Read the article

  • IIS can't serve files with accents and spaces in file names

    - by pho3nix
    My server recently stopped serve files with accents and spaces in filename. and example [http://jf-monteabraao.pt/UserFiles/File/OP%C3%87%C3%95ES%20DO%20PLANO%20-%20OR%C3%87AMENTO%202010.pdf][1] I not installed anything except urlscan but i seeing urlscan.ini and don't find any reference to this rule. anyone have idea whats happen?

    Read the article

  • Problem with accents in Exchange 2010 smtp messages

    - by mickey
    Installing brand new Exchange 2010 server. Everything is working pretty good, except that when we send email from the smtp server directly (not from a windows client like outlook), french accents are being replaced with other (random) characters. We are experiencing this problem with email sent from php and different app that we developped in house. I can reproduce the problem by connecting with telnet to the smtp server on port 25. I've tried searching on the net, but haven't found much. Any idea?

    Read the article

  • Windows 8 doubling accents and diacritical marks

    - by Time Sheep
    I don't know what I installed, but I must have installed something that caused Windows to act this way. Normally when I press the button with either of the characters below ¨ ^ ~ ´ ` Windows types 2 of the character. Because of this, I cannot type in accented characters without using a keymap. Since my surname contains a diarhesis (U-umlaut), this feature is quite essential to me. Several of my friends claim to have had this problem before using Windows 7 as well, but never found a solution apart from reinstalling Windows. How do I get my beloved accented characters back?

    Read the article

  • python raw_input odd behavior with accents containing strings

    - by Ryan
    I'm writing a program that asks the user for input that contains accents. The user input string is tested to see if it matches a string declared in the program. As you can see below, my code is not working: code # -*- coding: utf-8 -*- testList = ['má'] myInput = raw_input('enter something here: ') print myInput, repr(myInput) print testList[0], repr(testList[0]) print myInput in testList output in eclipse with pydev enter something here: má mv° 'm\xe2\x88\x9a\xc2\xb0' má 'm\xc3\xa1' False output in IDLE enter something here: má má u'm\xe1' má 'm\xc3\xa1' Warning (from warnings module): File "/Users/ryanculkin/Desktop/delete.py", line 8 print myInput in testList UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal False How can I get my code to print True when comparing the two strings? Additionally, I note that the result of running this code on the same input is different depending on whether I use eclipse or IDLE. Why is this? My eventual goal is to put my program on the web; is there anything that I need to be aware of, since the result seems to be so volatile?

    Read the article

  • Filtering Wikipedia's XML dump: error on some accents

    - by streetpc
    I'm trying to index Wikpedia dumps. My SAX parser make Article objects for the XML with only the fields I care about, then send it to my ArticleSink, which produces Lucene Documents. I want to filter special/meta pages like those prefixed with Category: or Wikipedia:, so I made an array of those prefixes and test the title of each page against this array in my ArticleSink, using article.getTitle.startsWith(prefix). In English, everything works fine, I get a Lucene index with all the pages except for the matching prefixes. In French, the prefixes with no accent also work (i.e. filter the corresponding pages), some of the accented prefixes don't work at all (like Catégorie:), and some work most of the time but fail on some pages (like Wikipédia:) but I cannot see any difference between the corresponding lines (in less). I can't really inspect all the differences in the file because of its size (5 GB), but it looks like a correct UTF-8 XML. If I take a portion of the file using grep or head, the accents are correct (even on the incriminated pages, the <title>Catégorie:something</title> is correctly displayed by grep). On the other hand, when I rectreate a wiki XML by tail/head-cutting the original file, the same page (here Catégorie:Rock par ville) gets filtered in the small file, not in the original… Any idea ? Alternatives I tried: Getting the file (commented lines were tried wihtout success): FileInputStream fis = new FileInputStream(new File(xmlFileName)); //ReaderInputStream ris = ReaderInputStream.forceEncodingInputStream(fis, "UTF-8" ); //(custom function opening the stream, reading it as UFT-8 into a Reader and returning another byte stream) //InputSource is = new InputSource( fis ); is.setEncoding("UTF-8"); parser.parse(fis, handler); Filtered prefixes: ignoredPrefix = new String[] {"Catégorie:", "Modèle:", "Wikipédia:", "Cat\uFFFDgorie:", "Mod\uFFFDle:", "Wikip\uFFFDdia:", //invalid char "Catégorie:", "Modèle:", "Wikipédia:", // UTF-8 as ISO-8859-1 "Image:", "Portail:", "Fichier:", "Aide:", "Projet:"}; // those last always work

    Read the article

  • PHP Include and accents (They show up as ?)

    - by user146780
    I'm using PHP include to include a PHP file that has HTML in it. some of the content has french accents and these show up as ? on the site. How can this be solved? Thanks Here is the PHP file I include: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="en-us" http-equiv="Content-Language" /> <title>Accueil</title> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta content="Changement créativité rêve buts être centré Plénitude personnel Développement transformation Modification nouveauté avancement bien-être Nouvelle vision ressentis L’énergie positive satisfaction l’acceptation Pardon" name="keywords" /> <link href="masterstyles.css" rel="stylesheet" type="text/css" /> <link href="menustyles.css" rel="stylesheet" type="text/css" /> <link href="menudropdown.css" rel="stylesheet" type="text/css" /> <td class="tbsyles" >&nbsp; <h3 class="bigorange"> ACTIVITÉS À VENIR…</h3> <p class="horizblue"> </p> <p class="bigblack"> <br /> Inscrivez-vous à nos conférences et formations <br /> <br /> </p> <h4 class="orange"> Example of some text that could be here<br /> </h4> <p class="horizblue"> &nbsp;</p> <h3 class="bigorange"> <br /> ABONNEZ-VOUS… </h3> <p class="nopadding"> À notre liste d’envoi </p> <form method="post" action="<?php echo $PHP_SELF;?>"> <?PHP function process_info(){ if(isset($_POST['email'])) { $email=$_POST["email"]; $email=strtolower($email); $action = "subc"; // check if email exists // check whether email is correct (basic checking) $test1=strpos($email, "@"); //value must be >1 $test2=strpos(substr($email,strpos($email,"@")), "."); //value must be >1 $test3=strlen($email); //value must be >6 $test4=substr_count ($email,"@"); //value must be 1 if ($test1<2 or $test2<2 or $test3<7 or $test4!=1) { print "<h6>Il a une erreur avec vôtre email</h6>"; print "<h6>Aucune informations ont été envoyer</h6>"; } else { print "<h5>vôtre address est enregistrer, Merci </h5>"; //If they wanted to subsribe, do it... $file = "emaillist-666XXX.txt"; // lets try to get the content of the file if (file_exists($file)){ // If the file is already in the server, its content is pasted to variable $file_content $file_content=file_get_contents($file); } else{ // If the file does not exists, lets try to create it // In case file can not be created (probably due to problems with directory permissions), // the users is informed (the first user will be the webmaster, who must solve the problem). $cf = fopen($file, "w") or die(""); fclose($cf); } // IF REQUEST HAS BEEN TO SUBSCRIBE FROM MAILING LIST, ADD EMAIL TO THE FILE if ($action=="subc"){ // check whether the email is already registered if(strpos($file_content,"<$email>")>0){die("");} // write the email to the list (append it to the file) $cf = fopen($file, "a"); fputs($cf, "\n$email"); // new email is written to the file in a new line fclose($cf); } } } } process_info(); ?> &nbsp;<p class="nopadding">Votre Courriel</p> <input name="email" type="text" class="style3" /> <input name="Submit" type="submit" value="OK" /></form> <p class="horizblue"></p> <h3 class="bigorange"> <br /> OUTILS GRATUIT… </h3> <p class="nopadding">Amusez-vous avec des outils intéressants</p> </td>

    Read the article

  • Remove accents from a JSON response.

    - by Pentium10
    I get back a JSON response from a social networks site. There are certain accented characters that I would like to be removed. An example is : L\u00e1szl\u00f3 M\u00e1rton, that reads "László Márton" and I would like to be transformed into Laszlo Marton. I would like to keep the JSON format intact, as I will send it towards. How can I do this?

    Read the article

  • cannot output a json encoded dict containing accents (noob inside)

    - by user296546
    Hi all, here is a fairly simple example wich is driving me nuts since a couple of days. Considering the following script: # -*- coding: utf-8 -* from json import dumps as json_dumps machaine = u"une personne émérite" print(machaine) output = {} output[1] = machaine jsonoutput = json_dumps(output) print(jsonoutput) The result of this from cli: une personne émérite {"1": "une personne \u00e9m\u00e9rite"} I don't understand why their such a difference between the two strings. i have been trying all sorts of encode, decode etc but i can't seem to be able to find the right way to do it. Does anybody has an idea ? Thanks in advance. Matthieu

    Read the article

  • How do I add ancient Greek accents in Ubuntu?

    - by Matthew
    I am taking a course in ancient Greek, and there are various accents that go above the vowels. I want to be able to type these on Ubuntu. For example, if I hit ';', then 'a' (while in the modern Greek keyboard layout), I get this character: ?. However, I can't figure out how to add the other accents (` and ^, for example).

    Read the article

  • Strange xml/html accent issue

    - by Ayrad
    I have an XML file that contains a message with html tags in it. The XML file is read by a java class that mails it to people. When the mail is received, the accents do not show. For example é doesn't show. I have tried &eacute; in the xml but it gives an error in eclipse saying that the entity has not been declared. I also tried simply inserting &#233; but that shows nothing in the final output. The 3rd thing I tried was using <![CDATA[é]]> but that broke the parser since it didn't output anything after it. However I noticed something weird. When i put something like this in the xml and added UTF-16 encoding <message>text bla bla blaa é&lt; it did ouput the é at the end like this bla bla blaa blaa é. EDIT <message>text bla bla blaa éé&lt; outputs ?é or just one é The file looks something like this: <?xml version="1.0"? encoding="UTF-16"> <message> &lt;b&gt;hello é &lt;/b&gt; </message> </xml> What gives?

    Read the article

  • Java how can I add an accented "e" to a string?

    - by behrk2
    Hello, 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 é (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 I cannot, as I am developing on a BlackBerry platform which does not support regular expressions and I have never been able to successfully add a third party library to my project. So, I have gotten to the point where any é is replaced with "e". My question now is, how do I add an actual 'accented e' to a string? Here is my code: public static String removeHTML(String synopsis) { char[] cs = synopsis.toCharArray(); String sb = new String(); boolean tag = false; for (int i = 0; i < cs.length; i++) { switch (cs[i]) { case '<': if (!tag) { tag = true; break; } case '>': if (tag) { tag = false; break; } case '&': char[] copyTo = new char[7]; System.arraycopy(cs, i, copyTo, 0, 7); String result = new String(copyTo); if (result.equals("&#x00E9")) { sb += "e"; } i += 7; break; default: if (!tag) sb += cs[i]; } } return sb.toString(); } Thanks!

    Read the article

  • How to remove accent characters from an InputStream

    - by Samuh
    I am trying to parse a Rss2.0 feed on Android using a Pull parser. XmlPullParser parser = Xml.newPullParser(); parser.setInput(url.open(), null); The prolog of the feed XML says the encoding is "utf-8". When I open the remote stream and pass this to my Pull Parser, I get invalid token, document not well formed exceptions. When I save the XML file and open it in the browser(FireFox) the browser reports presence of Unicode 0x12 character(grave accent?) in the file and fails to render the XML. What is the best way to handle such cases assuming that I do not have any control over the XML being returned? Thanks.

    Read the article

  • How to prevent CKEditor translating accented letters to their HMTL codes?

    - by shinjin
    I'd like to configure CKEditor to save accented letters as they are, and don't change them to their HTML equivalent, since I'm working work with UTF8 anyway. Where and what do I need to set to achieve this? Example: Current: entered: áéíóúöoüu source: <p>&aacute;&eacute;&iacute;&oacute;&uacute;&ouml;o&uuml;u</p> Wished for: entered: áéíóúöoüu source: <p>áéíóúöoüu</p>

    Read the article

  • Why can't I use accented characters next to a word boundary?

    - by Rexxars
    I'm trying to make a dynamic regex that matches a persons name. It works without problems on most names, until I ran into accented characters at the end of the name. Example: Some Fancy Namé The regex I've used so far is: /\b(Fancy Namé|Namé)\b/i Used like this: "Goal: Some Fancy Namé. Awesome.".replace(/\b(Fancy Namé|Namé)\b/i, '<a href="#">$1</a>'); This simply won't match. If I replace the é with a e, it matches just fine. If I try to match a name such as "Some Fancy Naméa", it works just fine. If I remove the word last word boundary anchor, it works just fine. Why doesn't the word boundary flag work here? Any suggestions on how I would get around this problem? I have concidered using something like this, but I'm not sure what the performance penalties would be like: "Some fancy namé. Allow me to ellaborate.".replace(/([\s.,!?])(fancy namé|namé)([\s.,!?]|$)/g, '$1<a href="#">$2</a>$3') Suggestions? Ideas?

    Read the article

1 2 3 4  | Next Page >