diacritics

Colored diacritics and unicode behaviour

吃可爱长大的小学妹 提交于 2021-02-18 07:52:12
问题 I just stumbled over this question about coloring diacritics. The task was to color diacritics in another color than the base text, like in á presenting a in blue and ´ in red. I thought I could give it a try, separating letter and diacritic through unicode combining marks, and applying another color to the diacritics by putting a span around it, like this: <p> p<span>̄ </span> o<span>̄ </span> m<span>̃ </span> o<span>̃ </span> d<span>̈ </span> o<span>̈ </span> r<span>̌ </span> o<span>̌ <

Colored diacritics and unicode behaviour

怎甘沉沦 提交于 2021-02-18 07:52:11
问题 I just stumbled over this question about coloring diacritics. The task was to color diacritics in another color than the base text, like in á presenting a in blue and ´ in red. I thought I could give it a try, separating letter and diacritic through unicode combining marks, and applying another color to the diacritics by putting a span around it, like this: <p> p<span>̄ </span> o<span>̄ </span> m<span>̃ </span> o<span>̃ </span> d<span>̈ </span> o<span>̈ </span> r<span>̌ </span> o<span>̌ <

Replace all accented characters by their LaTeX equivalent

隐身守侯 提交于 2021-02-17 15:24:17
问题 Given a Unicode string, I want to replace non-ASCII characters by LaTeX code producing them (for example, having é become \'e , and œ become \oe ). I'm incorporating this into a Python code. This should rely on a translation table, and I have come up with the following code, which is simple and seems to work nicely: accents = [ [ u"à", "\\`a"], [ u"é", "\\'e"] ] translation_table = dict([(ord(k), unicode(v)) for k, v in accents]) print u"été à l'eau".translate(translation_table) But, writing

Remove accents from a text file

岁酱吖の 提交于 2021-01-28 18:30:45
问题 I have issues with removing accents from a text file program replaces characters with diacritics to ? Here is my code: private void button3_Click(object sender, EventArgs e) { if (radioButton3.Checked) { byte[] tmp; tmp = System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(richTextBox1.Text); richTextBox2.Text = System.Text.Encoding.UTF8.GetString(tmp); } } 回答1: richTextBox1.Text = "včľťšľžšžščýščýťčáčáčťáčáťýčťž"; string text1 = richTextBox1.Text.Normalize(NormalizationForm.FormD);

Typing Greek characters in tkinter

拥有回忆 提交于 2021-01-27 06:52:01
问题 I'm trying to write an interface (in Python 3.8, using tkinter) to accept text in Greek (typed using the Greek Polytonic keyboard in Windows 10). However, the Entry and Text won't accept all typed Greek characters: Greek letters by themselves can be typed, but if I try to type any letters with diacritics other than the acute accent, ? is displayed instead of the character. (I think that tkinter accepts characters in the "Greek and Coptic" but not the "Greek Extended" Unicode block.) I know

How to remove diacritics (accents) from a string?

喜欢而已 提交于 2021-01-18 06:22:08
问题 I'm trying to convert some strings that are in Czech, Spanish, French etc. I'd like to take out the accent marks in the letters while keeping the letter. (E.g. convert é to e, č to c, Ž to Z, ñ to n) What is the best way to achieve this? Btw, there is a good similar question/answer for JavaScript 回答1: Not throughougly tested but seems to work void main() { var paragraph = "L'avantage d'utiliser le lorem ipsum est bien évidemment de pouvoir créer des maquettes ou de remplir un site internet de

PATINDEX with letter range exclude diacritics (accented characters)

瘦欲@ 提交于 2021-01-02 08:16:57
问题 I am trying to figure out how to use a patindex to find a range of letter characters, but exclude accented characters. If I do a straight search, using the default collate (insensitive) works just fine. However, when I search a range of letters, it will match on the accented character SELECT IIF('Ú' = 'U' COLLATE Latin1_General_CI_AI, 'Match', 'No') AS MatchInsensitive, IIF('Ú' = 'U' COLLATE Latin1_General_CI_AS, 'Match', 'No') AS MatchSensitive, PATINDEX('%[A-Z]%', 'Ú' COLLATE Latin1_General

PATINDEX with letter range exclude diacritics (accented characters)

南笙酒味 提交于 2021-01-02 08:15:28
问题 I am trying to figure out how to use a patindex to find a range of letter characters, but exclude accented characters. If I do a straight search, using the default collate (insensitive) works just fine. However, when I search a range of letters, it will match on the accented character SELECT IIF('Ú' = 'U' COLLATE Latin1_General_CI_AI, 'Match', 'No') AS MatchInsensitive, IIF('Ú' = 'U' COLLATE Latin1_General_CI_AS, 'Match', 'No') AS MatchSensitive, PATINDEX('%[A-Z]%', 'Ú' COLLATE Latin1_General

Use accent senstive primary key in MySQL

时光怂恿深爱的人放手 提交于 2020-08-05 06:01:36
问题 Desired result : Have an accent sensitive primary key in MySQL. I have a table of unique words, so I use the word itself as a primary key (by the way if someone can give me an advice about it, I have no idea if it's a good design/practice or not). I need that field to be accent (and why not case) sensitive, because it must distinguish between, for instance, 'demandé' and 'demande' , two different inflexions of the French verb "demander". I do not have any problem to store accented words in

Django - pdf response has wrong encoding - xhtml2pdf

为君一笑 提交于 2020-07-08 11:54:12
问题 I'm working on an invoice PDF generator on my Django website. I use xhtml2pdf . It seems to be working but encodings is not correct. There are wrong signs/characters when I use diacritics. This is a view: def render_to_pdf(template_src, context_dict): template = get_template("pdf/pdf.html") context = context_dict html = template.render(context) result = StringIO.StringIO() pdf = pisa.pisaDocument(StringIO.StringIO(html.encode('utf-8'), result) if not pdf.err: return HttpResponse(result