当输入特殊的“a”时,字符串的数量返回350。 [英] Count of string returns 350 when entering special "a"

查看:106
本文介绍了当输入特殊的“a”时,字符串的数量返回350。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!想问一下,这封信有什么问题:a̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍



我的尝试:



试图在fb墙上用这封信发帖子。

fb不允许发布包含这封信的消息说,fb安全阻止了这个局面nt。

google alse在尝试谷歌这封信时返回400错误。

如果你试着计算字符串的长度并输入这封信,你将得到350

任何想法是什么?

Hi! Wanted to ask, what's wrong with this letter: a̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍

What I have tried:

tried to post message on fb wall with that letter.
fb doesn't allow to post message containing this letter and saying, that fb security blocked this content.
google alse returns 400 error while trying to google this letter.
and if you try to count length of string and input this letter, you will get 350
any ideas what is this?

推荐答案

返回长度为350,因为该字符串包含350个字符。



要验证这一点,请选择文本并将其粘贴到Unicode编辑器中(例如用Notepad ++选择File - New,Encoding - UCS-2 Little Endian,然后粘贴文本)。

在Notepad ++中,它看起来像(缩短,'a'后会有349个点)。

It is returning a length of 350 because the string contains 350 characters.

To verify this, select the text and paste it into an Unicode editor (e.g. with Notepad++ choose File - New, Encoding - UCS-2 Little Endian, and paste the text).
Within Notepad++, it will look like (shortened, there will be 349 dots after the 'a').
a····



保存文件并使用十六进制编辑器打开它显示代码点(再次缩短):


Saving the file and opening it with a hex editor shows the code points (again shortened):

FF FE 61 00 0D 03 0D 03 0D 03



其中

FEFF = BOM(字节顺序标记)

0061 =字母'a'

030D =组合上面的垂直线



所以你有一个包含字母'a'的字符串和349字符组合垂直线。组合字符不会在前一个字符之后显示,而是与之组合。因为你有349个,所以'a'上方有349个。



这是一个例子,其中有一到三个:


where
FEFF = BOM (Byte Order Mark)
0061 = Letter 'a'
030D = Combining vertical line above

So you have a string containg the letter 'a' and 349 combining vertical line above characters. Combining characters are not shown after the preceding one but combined with it. Because you have 349 of them, there will be 349 above the 'a'.

This is an example with one to three of them:

a̍  a̍̍  a̍̍̍





因此大多数表格都不接受你的字符串就不足为奇了。这种组合字符的意图是在没有组合Unicode字符的情况下使用它们一次。



So there is no surprise that your string is not accepted by most forms. The intention of such combining characters is to use them once for the rare cases when there is no already combined Unicode character.


您应该学习尽快使用调试器。而不是猜测你的代码在做什么,现在是时候看到你的代码执行并确保它完成你期望的。



调试器允许你跟踪执行逐行检查变量,你会看到有一点它会停止你所期望的。

在Visual Studio 2010中掌握调试 - 初学者指南 [ ^ ]

http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html [ ^ ]

https://www.jetbrains.com/idea/help/debugging-your-first-java-application.html [ ^ ]



我担心这封信不是问题。

使用调试器确保你的代码真正按照你的想法行事。

简单测试:手动登录FB发布消息a,它有效吗?



否则,发布您正在使用的代码。
You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.

The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html[^]
https://www.jetbrains.com/idea/help/debugging-your-first-java-application.html[^]

I fear the letter is not the problem.
Use the debugger to make sure your code is really doing what you think it does.
Simple test: Log to FB manually and post the message "a", does it work ?

Otherwise, post the code you are using.


这篇关于当输入特殊的“a”时,字符串的数量返回350。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆