Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
unicode: IsPrint('\u3000') returns false #4661
What steps will reproduce the problem? 1. http://play.golang.org/p/Gtvj9bhAFl What is the expected output? IsPrint('\u3000') returns true. Please provide any additional information below. U+3000 (Ideographic Space) is used as a space character in Japanese. So It should be treated as a printable character.
"IsPrint" is a Go-defined property, not a Unicode-defined one. The only space character that satisfies IsPrint is the ASCII space. IsPrint gets used by things like %q to decide whether to escape a rune or not. By admitting only a single space character, we make sure that if you see something that looks like a space in a quoted string, it really is an ASCII space, not some other Unicode space. This applies to all kinds of spaces, not just Japanese spaces. For example, IsPrint('\u00A0') is false too. If you want to allow all kinds of spaces, use the Unicode-defined "graphic" property, called as unicode.IsGraphic.
Status changed to WorkingAsIntended.