non-ascii-characters

isalpha() giving an assertion

会有一股神秘感。 提交于 2019-11-27 05:27:38
I have a C code in which I am using standard library function isalpha() in ctype.h, This is on Visual Studio 2010-Windows. In below code, if char c is '£', the isalpha call returns an assertion as shown in the snapshot below: char c='£'; if(isalpha(c)) { printf ("character %c is alphabetic\n",c); } else { printf ("character %c is NOT alphabetic\n",c); } I can see that this might be because 8 bit ASCII does not have this character. So how do I handle such Non-ASCII characters outside of ASCII table? What I want to do is if any non-alphabetic character is found(even if it includes such character

Find non-ASCII characters in varchar columns using SQL Server

£可爱£侵袭症+ 提交于 2019-11-27 05:23:58
问题 How can rows with non-ASCII characters be returned using SQL Server? If you can show how to do it for one column would be great. I am doing something like this now, but it is not working select * from Staging.APARMRE1 as ar where ar.Line like '%[^!-~ ]%' For extra credit, if it can span all varchar columns in a table, that would be outstanding! In this solution, it would be nice to return three columns: The identity field for that record. (This will allow the whole record to be reviewed with

PHP-REGEX: accented letters matches non-accented ones, and vice versa. How to achieve this?

Deadly 提交于 2019-11-27 04:47:46
问题 I want to do typical highlight code. So I have something like: $valor = preg_replace("/(".$_REQUEST['txt_search'].")/iu", "<span style='background-color:yellow; font-weight:bold;'>\\1</span>", $valor); Now, the request word could be something like "josé". And with it, I want "jose" or "JOSÉ" or "José" etc highlighted too. With this expression, if I write "josé", it matches "josé" and "JOSÉ" (and all the case variants). It always matches the accented variants only. If I search "jose", it

preg_match with international characters and accents

荒凉一梦 提交于 2019-11-27 02:40:44
问题 I would like to validate a string with a pattern that can only contain letters (including letters with accents). Here is the code I use and it always returns "nok". I don't know what I am doing wrong, can you help? thanks $string = 'é'; if(preg_match( '/^[\p{L}]+$/i', $string)) { echo 'ok'; } else{ echo 'nok'; } 回答1: Add the UTF-8 modifier flag ( u ) to your expression: /^\p{L}+$/ui There is also no need to wrap \p{L} inside of a character class. 来源: https://stackoverflow.com/questions

How to MySQL work “case insensitive” and “accent insensitive” in UTF-8

泄露秘密 提交于 2019-11-27 01:34:23
问题 I have a schema in "utf8 -- UTF-8 Unicode" as charset and a collation of "utf8_spanish_ci". All the inside tables are InnoDB with same charset and collation as mentioned. Here comes the problem: with a query like SELECT * FROM people p WHERE p.NAME LIKE '%jose%'; I get 83 result rows. I should have 84 results, because I know it. Changing where for: WHERE p.NAME LIKE '%JOSE%'; I get the exact same 83 rows. With combinations like JoSe, Jose, JOSe, etc. All the same 83 rows are reported. The

matching unicode characters in python regular expressions

最后都变了- 提交于 2019-11-27 01:25:28
I have read thru the other questions at Stackoverflow, but still no closer. Sorry, if this is allready answered, but I didn`t get anything proposed there to work. >>> import re >>> m = re.match(r'^/by_tag/(?P<tag>\w+)/(?P<filename>(\w|[.,!#%{}()@])+)$', '/by_tag/xmas/xmas1.jpg') >>> print m.groupdict() {'tag': 'xmas', 'filename': 'xmas1.jpg'} All is well, then I try something with Norwegian characters in it ( or something more unicode-like ): >>> m = re.match(r'^/by_tag/(?P<tag>\w+)/(?P<filename>(\w|[.,!#%{}()@])+)$', '/by_tag/påske/øyfjell.jpg') >>> print m.groupdict() Traceback (most recent

How to handle Asian characters in file names in Git on OS X

陌路散爱 提交于 2019-11-27 00:26:56
问题 I'm on US-English OS X 10.6.4 and try to store files with Asian characters in its name in a Git repository. OK, let's create such a file in a Git working tree: $ touch どうもありがとうミスターロボット.txt Git is showing it as octal-escaped UTF-8 form: $ git version git version 1.7.3.1 $ git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # "\343\201\250\343\202\231\343\201\206\343\202\202\343\201\202\343\202\212\343\201\213

SyntaxError of Non-ASCII character [duplicate]

会有一股神秘感。 提交于 2019-11-27 00:16:12
This question already has an answer here: Correct way to define Python source code encoding 6 answers SyntaxError: Non-ASCII character '\xa3' in file when function returns '£' 4 answers I am trying to parse xml which contains the some non ASCII cheracter, the code looks like below from lxml import etree from lxml import objectify content = u'<?xml version="1.0" encoding="utf-8"?><div>Order date : 05/08/2013 12:24:28</div>' mail.replace('\xa0',' ') xml = etree.fromstring(mail) but it shows me error on the line 'content = ...' like syntaxError: Non-ASCII character '\xc2' in file /home/projects

How do I remove all non-ASCII characters with regex and Notepad++?

给你一囗甜甜゛ 提交于 2019-11-26 23:30:04
I searched a lot, but nowhere is it written how to remove non-ASCII characters from Notepad++. I need to know what command to write in find and replace (with picture it would be great). If I want to make a white-list and bookmark all the ASCII words/lines so non-ASCII lines would be unmarked If the file is quite large and can't select all the ASCII lines and just want to select the lines containing non-ASCII characters... ProGM This expression will search for non-ASCII values: [^\x00-\x7F]+ Tick off 'Search Mode = Regular expression', and click Find Next . Source: Regex any ASCII character

Check If the string contains accented characters in SQL?

拟墨画扇 提交于 2019-11-26 23:14:35
I want to perform a task if the input string contain any accented characters else do another task in SQL. Is there any way to check this condition in SQL ? Eg: @myString1 = 'àéêöhello!' IF(@myString1 contains any accented characters) Task1 ELSE Task2 JohnLBevan SQL Fiddle: http://sqlfiddle.com/#!6/9eecb7d/1607 declare @a nvarchar(32) = 'àéêöhello!' declare @b nvarchar(32) = 'aeeohello!' select case when (cast(@a as varchar(32)) collate SQL_Latin1_General_Cp1251_CS_AS) = @a then 0 else 1 end HasSpecialChars select case when (cast(@b as varchar(32)) collate SQL_Latin1_General_Cp1251_CS_AS) = @b