Detect all accents not found in English or French

how to type french accents on english keyboard
diacritics
french words with accents list
a with accent
e with accent
diacritical marks meaning
how to type french accents windows 10
accent marks pronunciation

I find myself needing to detect whether a string contains any characters that do not exist in English or French. The string is gathered via HTML input field.

I have found a few examples of how to normalize the string, but this is NOT what I need to do (french accents should not be normalized).

So far, I find myself doing this:

if (str.includes(invalidAccents)){
    //do something
} else {
    //do something else
}

with a list I put together stored in an array:

var invalidAccents = [
    'á', 'ã', 'ä', 'å', 'ą', 'æ',
    'ĉ', 'ć',
    'ę',
    'ĝ',
    'ĥ',
    'í', 'ì', 'ł',
    'ĵ',
    'ñ', 'ń',
    'ó', 'ò', 'õ', 'ö', 'ø', 'œ', 'ó',
    'ŝ', 'ś',
    'ú', 'ŭ',
    'ÿ', 'ý',
    'ž', 'ź', 'ż',
    'ª',
    'ð',
    'ß',
    'ƒ',
    'þ',
    'µ',
    'Á', 'Ã', 'Ä', 'Å', 'Ą', 'Æ',
    'Ĉ', 'Ć',
    'Ę',
    'Ĝ',
    'Ĥ',
    'Í', 'Ì', 'Ł',
    'Ĵ',
    'Ñ', 'Ń',
    'Ó', 'Ò', 'Õ', 'Ö', 'Ø', 'Ó', 'Œ',
    'Ŝ', 'Ś',
    'Ú', 'Ŭ',
    'Ÿ', 'Ý',
    'Ž', 'Ź', 'Ż',
    'Ð',
    'Þ' 
];

but this is far from efficient and far from exhaustive.

Does anyone have an alternative solution or at least a place where I can find a complete list of accents to complete what I've got going?

International Keyboard and accented characters, To obtain special characters and accents on a Macintosh computer, use the Option key and For the US-International keyboard, add another "English" keyboard whose When you press, say, an apostrophe, it does not show on the screen. For all Windows programs, such as Excel, IE, Netscape, Word, WordPerfect, the� Let’s take a look at how to pronounce each of the five French accent marks. I’ll also explain the purpose of each of the accents. 1. The Cedilla (La Cédille) in French. The cedilla in French looks like a little squiggle beneath the letter “c”: “ç”. This accent mark only goes with the letter “c” — it's not found under any

Well, the short answer is: aside using lists, you can use Unicode ranges, but this way requires to iterate strings and check each character separately..

See charCodeAt and such.

If you look at Unicode table, you can see that codes 192-214, 217-221, 224-229 etc correspond to symbols with accents (I'd recommend to check it youself, I'm not sure whether 'ß' is called a symbol with accent).

Iterating to check those can look like:

function containsAccented(str) {
    const ranges = [[192,214], [217,221], ....];
    for(let c of str) {
        let code = c.charCodeAt(0);
        for(let range of ranges)
            if(code >= range[0] && code <= range[1])
                return true;
    }
    return false;
}

If you want to automate somehow creating the ranges themselves, you have to find a proper definition of "not found in English or French" and whether some service describes those, not sure if there's any.

French Accent Marks: The Ultimate Guide, We'll cover all the different types of accent, how they're pronounced (if they're This accent mark only goes with the letter “c” — it's not found under any other letter. don't speak Spanish, you may find that explanation helpful for your French). How to use French accent codes (ALT codes) to type French accents on a PC Chrysanthème : One of many French words written with an accent grave . As I’ve said, ALT codes can be slow and annoying, but some people get used to them and even prefer them to other methods of typing French accents.

Create a list of the valids one, this list is kwown and short.

You can find inspiration with the iso-8859-15 charset: https://fr.m.wikipedia.org/wiki/ISO/CEI_8859-15

Using Accents and Diacritics in English, They know that the acute accent in caf� means the final e is not silent (IPA: [eɪ]), Many a caf� in the English-speaking world offers its customers a latt�, but the for English speakers since they may find them completely unfamiliar: while most All the examples of diacritics that we have seen so far have their origins in� French accents • Entering accents with a PC • Entering accents with a Mac • HTML & other Internet languages French accents In this course, you will need to type accents for written assignments, both for compositions and for web assignments and messages for the electronic bulletin board (CUBBoard).

How to Generate French Characters on any Keyboard by , Here is a list of all the common characters (with both sets of ALT codes): �, A with Accent Grave (ALT + 0192), �, A with Accent Grave (ALT + 0224/133), � The keyboard itself does not generate the French Characters; it generates the are available on either a French Canadian legended or English legended keyboard. If you currently use the English-US keyboard layout, the international keyboard is far and away your best option for typing accents. It is not a separate keyboard, just a Windows setting. If you use an English-UK keyboard, the UK extended keyboard is the best. Your other options are the French keyboard, the Canadian French keyboard, and ALT codes.

How to Easily Type and Pronounce French Accents (With Alt Codes), Discover how to type French accents such as the acute accent, grave and L' accent circonflexe (circumflex)can be used on all vowels to indicate a is that the French word has an accent circonflexe while the English word has an “s”. Forget the cedilla and you're not saying le�on (lesson) anymore but le� Called English Dialects, the app generates a heat map based on your answers and guesses where your accent is from. The free app, available for iOS and Android , was built by researchers from the

Type French accents in Windows, If you're a US Windows user, the best way to type accents is by making a simple type accents and guillemets (French quotation marks); No need to switch between that keyboard layout, which is listed as something like English ( international): Then under Input Method, select Add an input method, and find or search for� 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".

Comments
  • It would be a lot simpler to check the string only contains allowed characters rather than check for illegal characters. There are only a limited number of accents allowed in English/French, but an enormous amount of characters in Unicode.
  • fair point. Still, thats over 70 characters in an array. Is there not a more efficient method?
  • Just use a regex ^[A-Za-z]+$
  • @QuentinVeronthis would return false for french accents. This is not acceptable.
  • console.log(containsAccented('hello')); returns undefined <- should be false
  • console.log(containsAccented('héllo')); returns true <- should be false
  • console.log(containsAccented('héllö')); returns true <- should be true
  • @Sweepster, like I said, you have to adjust the ranges by yourself according to your needs. Presumably also invert the logic like JacquesB has suggested
  • I did set up the ranges as needed. Even if I invert the logic, it doesn't explain why I'm getting undefined.