English 中文(简体)
[......]
原标题:Go []int to rune
for pos, char := range s {
        fmt.Println( utf8.RuneLen(char) )
}

该法典在Go(前第1条)运作,但在Go1公司工作。

不能将果园(类型[int])作为功能论证中的类型

我拿着将“utf8”进口升级到“单编码/utf8”的固定办法,但现在我拿到了原来的手。

docs forpre,其中提到三维转换将解决这一错误。

最佳回答

The code you posted works in Go1. Assuming s is a string.

Make sure you aren t unexpectedly introducing or using some other variable named char which has type []int, and make sure there are no typos in your code which would lead to unexpected usage of a different variable.

问题回答

暂无回答




相关问题
Message charset

How do I get the charset from javax.mail.Message object?

Adding "charset" to all ASP.NET MVC HTTP responses

Is there an easy way to specify all "normal" views is an ASP.NET MVC app are to have charset=utf-8 appended to the Content-Type? View() lacks an override that allows you to specify the Content-Type, ...

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Special characters are not supported

I am having problem to display the special characters like ’, é in Firefox and IE. But these characters are supported for the local server. I have used the following <!DOCTYPE html PUBLIC "-...

找到一份所有编码的一览表。

我正在撰写一篇文章,试图将 by铁丝带入第2.6条的许多不同的编码。 是否有办法获得一份清单,列出我可以重复的可用编码?

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

Flash coding problem

I got some information in my Flash application from a php script. Flash displayed it as: Radioart=Mia Frejman - Ett hjärta - Ett Hjärta The string contain some Swedish symbols. How I can output ...

热门标签