TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Dealing with Unicode in Go

8 pointsby hermanschaafalmost 12 years ago

2 comments

tptacekalmost 12 years ago
Here's Rob Pike on this issue:<p><a href="https://groups.google.com/d/msg/golang-nuts/1yL7IsqADSw/GS8Fex5BCbkJ" rel="nofollow">https://groups.google.com/d/msg/golang-nuts/1yL7IsqADSw/GS8F...</a><p>Golang's Unicode support (in 2012 at least) is "less than rudimentary".<p>In practice, I find Go's Unicode support superior to all the other languages I've shipped with --- C/C++, ObjC, Ruby, and Python, mostly --- mostly because it draws a line between "strings" and "byte vectors" (the way Cocoa does with NSData/NSString) and has a solid UTF-8 library. Your support for Unicode does need to be explicit and somewhat hand-rolled, but unlike (say) Ruby, the language doesn't trick you into thinking you're handling Unicode when you're not, and unlike Python, handling Unicode doesn't push you into an alternate type space.<p>(Conceding rapidly: I've shipped the least amount of code in Python and there is probably an elegant Pythonic solution I'm just not aware of).
cthom06almost 12 years ago
I commented on the article, but here as well. When dealing with unicode in Go you should be converting strings to []rune
评论 #5757634 未加载
评论 #5757618 未加载