问题标签 [non-ascii-characters]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - 正则表达式重音不敏感?
我需要一个C #程序中的正则表达式。
我必须捕获具有特定结构的文件的名称。
我使用了\w
char 类,但问题是这个类不匹配任何重音字符。
那么如何做到这一点呢?我只是不想将最常用的重音字母放在我的模式中,因为理论上我们可以将每个重音字母放在每个字母上。
所以我虽然可能有一个语法,说我们想要一个不区分大小写的(或一个考虑重音的类),或者一个允许我不区分大小写的正则表达式选项。
你知道这样的事情吗?
非常感谢你
c - isalpha() giving an assertion
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:
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 not in 8-bit ASCII table) i want to be able to neglect it.
php - 将特殊字符(即变音符号)转换为最可能的 ascii 表示形式
我正在寻找一种方法,或者可能是一个转换表,它知道如何将元音变音和特殊字符转换为它们在 ascii 中最可能的表示形式。
例子:
有人知道吗?
更新:除了公认的答案之外,我还发现 PECLs Normalizer非常有趣,尽管我无法使用它,因为服务器没有它并且没有为我更改。
如果这里的答案对您没有足够的帮助,也请查看此问题。
vb.net - 编码 737 混淆
我正在使用 VB .Net 2008
为什么我使用Encoding.Convert
返回可读字符的命令从 ASCII 转换为 737(希腊语 DOS),而IO.StreamWriter
withEncoding.GetEncoding(737)
写入的文件包含不可读字符?
我问这个是因为我想将行数据发送到可以将希腊语打印为 737 的打印机。如果我发送 的结果Encoding.Covert
,我会得到错误的结果,而如果我像上面那样写一个文件并将其复制到打印机是好的
c - 反转包含 ASCII 字符和非 ASCII 字符的字符串
我遇到了关于如何反转包含此“abcd汉字efg”的字符串的问题。
还原后应该是:
我想,要反转字符串,我必须识别那些非 ASCII 字符,因为我认为简单地反转每个字节不会得到正确的答案。
我该怎么做?
PS:我在 32 位 Ubuntu 下编写了这个程序。然后我打印了每个字节:
我得到了一些乱码而不是“汉字”。
fonts - 粘贴后重音字符看起来很奇怪(在字符后面显示重音)
不确定这是否是询问或 doctype 的合适位置,但无论如何我都会问......一直在与德国客户合作,这个非常奇怪的问题开始出现......
因此,在为网站填充内容时,我从他们的 pdf 表中复制/粘贴到我的编辑器 (Espresso) 中。奇怪的是,虽然所有文本在编辑器上看起来都很原始,但在浏览器中打开后,我们开始发现带有重音字符的异常异常,被向前推进。所以一个 ' ' 显示为 O" ,依此类推。
我认为这是一些 unicode 问题,但该站点被声明为 utf8 ,并且没有输入富文本或任何内容,它只是来自编辑器的原始文本。所以这真的令人难以置信。如果客户端直接编辑文件,它会正确显示。我发现如果我手动输入和替换重音字符,也很好。
任何人都有类似的经验/解决方案?
我应该不应该有本地化/字体问题,因为这些本质上是拉丁字符?(如我错了请纠正我)
c++ - 为什么这个字符会停止我的程序?
换行符在 C++ 中是否有某种特殊意义?它是非ASCII字符吗?
我正在尝试为更大的文本中的每个唯一的 n 字符子字符串构建马尔可夫链。每次我遇到一个新的唯一子字符串时,我都会将它输入到一个映射中,该映射的值是一个 256 个元素的向量(扩展 ASCII 表中的每个字符一个元素)。
当我打印出文件的全部内容时没有问题(“行”是使用 ifstream 和 getline 构建的文本行向量):
整个文本文件显示在控制台中。当我尝试将换行符返回给需要一个字符的函数时,就会出现问题。“moveSpaces”是一个整数常量,用于确定每次迭代时在字符串向量中向前移动的字符数。
我已经使用了调试器,当它到达第 2 行的第 1 列时,它对我来说很糟糕——没有错误或任何东西。它在此函数中失败,而不是在调用函数中。
我正在使用的文件是圣诞颂歌(古腾堡计划中出现的第一件事)。作为参考,这里是前几行:
该函数在应该返回第二行的第一个字符时中断。如果我去掉换行符,或者我在程序中逐行构建“行”向量,则不会发生这种情况。知道有什么问题吗?
c# - .Net MVC 2, return File that contains non-ASCII characters in the filename
I am working on a data export task that needs to be able to export in any language. All the languages that use strictly ASCII characters work just fine, but when I go for data exports in oriental languages, it throws the following exception: "An invalid character was found in the mail header" With a bit of research, I determined that this was due to the RFC 2183 spec which states that "Parameter values longer than 78 characters, or which contain non-ASCII characters, MUST be encoded as specified in [RFC 2184]"
I read both of these documents and they weren't much of a help. I understand that there is a need to send the data in UTF-8 encoding in order to locate the file. However, this makes the downloaded file name appear as encoded UTF-8. As of now, I am encoding the file names into UTF using the functions I will post below. (All of this is in C#, MVC2)
And the file is returned in the following function:
Strictly speaking, this works. However, the entire file name ends up UTF-Encoded when it reaches the user. I'm looking for a way to pass back that pre-existing file to the user, such that it can keep its non-ASCII characters.
Any help is appreciated.
iphone - 在 iPhone 上检查键盘输入的 ASCII 兼容性
当用户点击键盘时,我需要知道输入符号是否属于 ASCII 调色板,否则将其剥离。
所以我需要做什么
检查输入字符的方法?
目前,当用户使用(例如)俄语键入时,我从输入字符串中获取 ASCII 字符:
windows - haskell:输出非ASCII字符
我想在 WinGHCi 中输出非 ascii 字符,但这就是我得到的:
我在 windows xp 上使用 WinGHCi 7.0.3。我该怎么做才能让 WinGHCi 打印出漂亮的小增量?