non-english

Non-English domain naming issues in programming

≯℡__Kan透↙ 提交于 2019-12-21 09:18:38
问题 Most programming code, I imagine is written in English. But I'm curious how people are handling the issue of naming herein. A lot of programming is done within some bussiness domain, usually with well established terms for certain procedures, items. I'm from Denmark for instance, and something I work a lot with has a term called "indblikskode", which sort of translates to "insight code". So, do I use the line "string indblikskode = ..." in the C# code for some web service related to this? Or

Foreign language characters in Regular expression in C#

雨燕双飞 提交于 2019-12-18 12:00:04
问题 In C# code, I am trying to pass chinese characters: " 中文ABC123" . When I use alphanumeric in general using "^[a-zA-Z0-9\s]+$" , it doesn't pass for "中文ABC123" and regex validation fails. What other expressions do I need to add for C#? 回答1: To match any letter character from any language use: \p{L} If you also want to match numbers: [\p{L}\p{Nd}]+ \p{L} ... matches a character of the unicode category letter. it is the short form for [\p{Ll}\p{Lu}\p{Lt}\p{Lm}\p{Lo}] \p{Ll} ... matches lowercase

Handling SEO Friendly URL with Non-English Characters

我的未来我决定 提交于 2019-12-13 17:30:22
问题 I have URLs like this: .com/topic.php?id=6 I can convert them to this: .com/topic/5.html This works, but now I want to convert .com/topic/title.html The "title" is dynamic, for example çağdaş and can contain non-English characters like Ş or Ğ or Ü In this case, I first convert characters to acceptable equivalents like Ş to S or Ü to U If I convert çağdaş to cagdas then my URL looks like this .com/topic/cagdas.html I have used cagdas in SQL queries to select the proper row, but in the database

how to send a non-english word (chinese) email using django

时光总嘲笑我的痴心妄想 提交于 2019-12-12 19:43:26
问题 if i use a chinese word subject : subject = u'邮件标题' it will be show error : UnicodeDecodeError at /account/login_view/ 'utf8' codec can't decode bytes in position 0-1: invalid data what can i do about it , thanks updated def register_view(request): if request.method == 'POST': form = SignupForm(request.POST) if form.is_valid(): # Process the data in form.cleaned_data # ... username = form.cleaned_data['username'] password = form.cleaned_data['password'] email = form.cleaned_data['email'] user

Removing non-english words from a sentence in python

纵饮孤独 提交于 2019-12-10 23:49:49
问题 I have written a code which sends queries to Google and returns the results. I extract the snippets(summaries) from these results for further processing. However, sometime non-english words are in these snippets which I don't want them. for example: /\u02b0w\u025bn w\u025bn unstressed \u02b0w\u0259n w\u0259n/ I only want the "unstressed" word in this sentence. How can I do that? thanks 回答1: PyEnchant might be a simple option for you. I do not know about its speed, but you can do things like:

How to pass nvarchar (non-English) to CLR (C#) stored procedure?

空扰寡人 提交于 2019-12-09 06:08:28
Working in Visual Studio, I'm trying to pass an entire row to a CLR stored procedure using FOR XML RAW and a parameter of type SqlXml in C# code (with the intent of processing the row using XmlReader). The row contains nvarchar fields. Everything works correctly when the nvarchar fields contain English/numeric/simple punctuation text, but when any of them contain Hebrew or Russian characters, these characters are turned into question marks. (The same for Russian-only text so not an RTL issue) From prints in SQL code I've found that the xml created by XML RAW preserves the non-English

How to pass nvarchar (non-English) to CLR (C#) stored procedure?

喜夏-厌秋 提交于 2019-12-08 06:51:42
问题 Working in Visual Studio, I'm trying to pass an entire row to a CLR stored procedure using FOR XML RAW and a parameter of type SqlXml in C# code (with the intent of processing the row using XmlReader). The row contains nvarchar fields. Everything works correctly when the nvarchar fields contain English/numeric/simple punctuation text, but when any of them contain Hebrew or Russian characters, these characters are turned into question marks. (The same for Russian-only text so not an RTL issue)

Facebook Graph API - non English album names

为君一笑 提交于 2019-12-07 09:46:30
问题 I am trying to do a simple thing - get all my albums. the problem is that the album names are non-English ( they are in Hebrew ). The code that retrieves the albums : string query = "https://graph.facebook.com/me/albums?access_token=..."; string result = webClient.DownloadString(query); And this is how one of the returned albums looks like : { "id": "410329886431", "from": { "name": "Noam Levinson", "id": "500786431" }, "name": "\u05ea\u05e2\u05e8\u05d5\u05db\u05ea \u05d2\u05de\u05e8 \u05e9

how to sort non-english strings?

ε祈祈猫儿з 提交于 2019-12-07 08:10:55
问题 I did look up answers, and they are good for the standard alphabet. but I have a different situation than that. so, I am programming in Java. I am writing a certain program. this program has at some place some list of string items. I would like to sort those string items according to the alphabet. if I would sort it by English alphabet, it would be easy since usually all code pages are compatible with American standard code for information interchange (ASCII), and they have all letters of

possible to raise exception that includes non-english characters in python 2?

ε祈祈猫儿з 提交于 2019-12-07 02:24:20
问题 I'm trying to raise exception in python 2.7.x which includes a unicode in the message. I can't seem to make it work. Is it not supported or not recommended to include unicode in error msg? Or do i need to be looking at sys.stderr? # -*- coding: utf-8 -*- class MyException(Exception): def __init__(self, value): self.value = value def __str__(self): return self.value def __repr__(self): return self.value def __unicode__(self): return self.value desc = u'something bad with field \u4443' try: