char

Why 255 is the limit

戏子无情 提交于 2020-08-22 19:38:56
问题 I've seen lots of places say: The maximum number of characters is 255. where characters are ASCII. Is there a technical reason for that? EDIT: I know ASCII is represented by 8 bits and so there're 256 different characters. The question is why do they specify the maximum NUMBER of characters (with duplicates) is 255. 回答1: I assume the limit you're referring to is on the length of a string of ASCII characters. The limit occurs due to an optimization technique where smaller strings are stored

Why 255 is the limit

一曲冷凌霜 提交于 2020-08-22 19:38:30
问题 I've seen lots of places say: The maximum number of characters is 255. where characters are ASCII. Is there a technical reason for that? EDIT: I know ASCII is represented by 8 bits and so there're 256 different characters. The question is why do they specify the maximum NUMBER of characters (with duplicates) is 255. 回答1: I assume the limit you're referring to is on the length of a string of ASCII characters. The limit occurs due to an optimization technique where smaller strings are stored

Convert string to unicode [duplicate]

倖福魔咒の 提交于 2020-08-05 05:37:13
问题 This question already has answers here : How to convert a string with Unicode encoding to a string of letters (18 answers) Closed 4 years ago . i want convert a simple text like, "my simple text" to Unicode character in Android. for example this : "\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc" this string in uni code is : برنامه نویسی i want input برنامه نویسی and response "\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc" this string . please help me