The following is a rough solution for replacing characters in a string. Do use the STL, it can help you a lot with the looping part. Thus, at least two kinds of bugs can occur: translation bugs and looping bugs. Now, as for the rest of your code, it is error prone because you mix the looping logic with translation logic. This hole goes deep, so I'll leave it at that. formed by placing a tilde (also referred to as a virgulilla in Spanish) on top of an upper- or lower-case N.
For one thing, wide characters aren't meant to handle variable width encodings. How to type Spanish n with tilde in Excel. There is std::wstring but I'm not sure I'd use that. That being said, your problem is that you're dealing with multi-character strings. These shortcuts can work on any software such as in your browser, MS Word, Excel, and PowerPoint, on both. For Mac Users, press OPTION + n then a, on your keyboard. That is, look for a solution that will allow you to support characters encoded in Unicode or for the user's locale. To type the A with Tilde Accent symbol, press down the Alt key and type 0195 or 0227 (i.e., A Tilde Accent Alt Codes) using the numeric keypad, then let go of the Alt key. I definitely think you should look into the root of the problem. I'm using this code: for (it= dictionary.begin() it != dictionary.end() it++)įound=toReplace.find_first_of(strMine,found+1) I tried replace it directly but with replace method of string class but I could not get that to work. Example: I want to replace this word: "había" for habia. I want to replace them for their not accented counterparts. This means that I have a lot of words with accents and tildes. I have a problem with a string in C++ which has several words in Spanish.