FAQ
So I've updated golang to the default branch and built it from source.

The problem is still there.

This is the code I'm using:

package main

import (
"bufio"
"fmt"
"os"
)

func main() {
fmt.Println("Example")
print("example: ")
in := bufio.NewReader(os.Stdin)
input, err := in.ReadString('\n')
if err != nil {
fmt.Println("Error: ", err)
return
}
fmt.Println(input)
}


And I still get a square with an "?" inside each time I use a character
like ã õ á é í...

I would guess it's a problem with the windows console, but a similar ruby
program returns the correct characters... :/

Domingo, 27 de Janeiro de 2013 5:30:21 UTC, Celso Miranda escreveu:
I didn't know that.

I'll try and find another solution. Thanks.

Domingo, 27 de Janeiro de 2013 3:18:44 UTC, Andy Balholm escreveu:
On Saturday, January 26, 2013 7:00:56 PM UTC-8, Celso Miranda wrote:

I've also noted that if I input a setence into a string, only the first
word is returned. "my name is celso" outputs "my". I don't know if this is
related or not. :/
fmt.Scanln, like scanf in C, reads space-separated tokens. So when you
scan a string, you get one word.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 13 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 26, '13 at 6:49p
activeFeb 5, '13 at 5:12a
posts13
users6
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase