unicode-normalization

Unicode Normalization in Windows

吃可爱长大的小学妹 提交于 2019-12-04 15:36:18
问题 I've been using "unicode strings" in Windows for as long as... I've learned about Unicode (e.g. after graduating). However, it always mystified me that the Win32API mentions "unicode" very loosely. In particular, "unicode" variant mentioned by MSN is UTF-16 (although the "wide char" terminology comes from the fact that it used to be UCS-2, which is not Unicode). However, it makes almost no mention of Unicode Normalization. MSN has a few pages about Unicode and Unicode Normalization Forms and

how to extract characters from a Korean string in VBA

白昼怎懂夜的黑 提交于 2019-12-04 14:43:13
Need to extract the initial character from a Korean word in MS-Excel and MS-Access. When I use Left("한글",1) it will return the first syllable i.e 한, what I need is the initial character i.e ㅎ . Is there a function to do this? or at least an idiom? If you know how to get the Unicode value from the String I'd be able to work it out from there but I'm sure I'd be reinventing the wheel. (yet again) I think what you are looking for is a Byte Array Dim aByte() as byte aByte="한글" should give you the two unicode values for each character in the string Disclaimer: I know little about Access or VBA, but

Replace éàçè… with equivalent “eace” In GWT

喜夏-厌秋 提交于 2019-12-04 01:58:05
问题 I tried s=Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", ""); But it seems that GWT API doesn't provide such fonction. I tried also : s=s.replace("é",e); But it doesn't work either The scenario is I'am trying to générate token from the clicked Widget's text for the history management 回答1: You can take ASCII folding filter from Lucene and add to your project. You can just take foldToASCII() method from ASCIIFoldingFilter (the method does not have any dependencies).

When to use Unicode Normalization Forms NFC and NFD?

时光怂恿深爱的人放手 提交于 2019-12-03 16:16:59
问题 The Unicode Normalization FAQ includes the following paragraph: Programs should always compare canonical-equivalent Unicode strings as equal ... The Unicode Standard provides well-defined normalization forms that can be used for this: NFC and NFD. and continues... The choice of which to use depends on the particular program or system. NFC is the best form for general text, since it is more compatible with strings converted from legacy encodings. ... NFD and NFKD are most useful for internal

Unicode string normalization in C/C++

試著忘記壹切 提交于 2019-12-03 11:42:06
Am wondering how to normalize strings (containing utf-8/utf-16) in C/C++. In .NET there is a function String.Normalize . I used UTF8-CPP in the past but it does not provide such a function. ICU and Qt provide string normalization but I prefer lightweight solutions. Is there any "lightweight" solution for this? Avi As I wrote in another question , utf8proc is a very nice, lightweight, library for basic Unicode functionality, including Unicode string normalization. For Windows, there is the NormalizeString() function (unfortunately for Vista and later only - as far as I see on MSDN): http://msdn

Replace éàçè… with equivalent “eace” In GWT

♀尐吖头ヾ 提交于 2019-12-01 10:53:24
I tried s=Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", ""); But it seems that GWT API doesn't provide such fonction. I tried also : s=s.replace("é",e); But it doesn't work either The scenario is I'am trying to générate token from the clicked Widget's text for the history management okrasz You can take ASCII folding filter from Lucene and add to your project. You can just take foldToASCII() method from ASCIIFoldingFilter (the method does not have any dependencies). There is also a patch in Jira that has a full class for that without any dependencies - see here . It

How do I make toLowerCase() and toUpperCase() consistent across browsers

心已入冬 提交于 2019-12-01 06:02:58
问题 Are there JavaScript polyfill implementations of String.toLowerCase() and String.toUpperCase(), or other methods in JavaScript that can work with Unicode characters and are consistent across browsers? Background info Performing the following will give difference results in browsers, or even between browser versions (E.g FireFox 54 vs 55): document.write(String.fromCodePoint(223).normalize("NFKC").toLowerCase().toUpperCase().toLowerCase()) In Firefox 55 it gives you ss , in Firefox 54 it gives

Python regex \\w doesn't match combining diacritics?

只谈情不闲聊 提交于 2019-11-30 13:05:51
I have a UTF8 string with combining diacritics. I want to match it with the \w regex sequence. It matches characters that have accents, but not if there is a latin character with combining diacritics. >>> re.match("a\w\w\wz", u"aoooz", re.UNICODE) <_sre.SRE_Match object at 0xb7788f38> >>> print u"ao\u00F3oz" aoóoz >>> re.match("a\w\w\wz", u"ao\u00F3oz", re.UNICODE) <_sre.SRE_Match object at 0xb7788f38> >>> re.match("a\w\w\wz", u"aoo\u0301oz", re.UNICODE) >>> print u"aoo\u0301oz" aóooz (Looks like the SO markdown processer is having trouble with the combining diacritics in the above, but there

How do I check equality of Unicode strings in Javascript?

喜夏-厌秋 提交于 2019-11-30 08:20:25
I have two strings in Javascript: "_strange_chars_µö¬é@zendesk.com.eml" ( f1 ) and "_strange_chars_µö¬é@zendesk.com.eml" ( f2 ). At first glance, they look identical (and, indeed, on StackOverflow, they may be; I'm not sure what happens when they are pasted into a form like this.) In my application, however, f1[16] // ö f2[16] // o f1[17] // ¬ f2[17] // ̈ That is, where f1 uses the ö character, f2 uses an o and a diacritic ¨ as a separate character. What comparison can I do that will show these two strings to be "equal"? f1 uses the ö character, f2 uses an o and a diacritic ¨ as a separate

How to convert unicode accented characters to pure ascii without accents?

梦想与她 提交于 2019-11-30 02:23:51
I'm trying to download some content from a dictionary site like http://dictionary.reference.com/browse/apple?s=t The problem I'm having is that the original paragraph has all those squiggly lines, and reverse letters, and such, so when I read the local files I end up with those funny escape characters like \x85, \xa7, \x8d, etc. My question is, is there any way i can convert all those escape characters into their respective UTF-8 characters, eg if there is an 'à' how do i convert that into a standard 'a' ? Python calling code: import os word = 'apple' os.system(r'wget.lnk --directory-prefix=G: