Is there a way to use the Serial Monitor at MIDI speed? (31250 baud)
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
> an email to developers+unsubscribe@arduino.cc.
I've set the different ports to different baud rates before -- Cristian, did something change with 1.5? Try with 115200 on one and something standard like 9600 on the other. The serial monitor won't read the 31250.
Sent from my Android device with K-9 Mail. Please excuse my brevity. --
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
On Aug 31, 2013 6:31 AM, "Matthew Ford" <matthe...@forward.com.au> wrote:
>
> No comments on this so far.
> Could it be that the IDE saves the sketch in UTF-8 format and that as a result the gcc compiler gets the UTF-8 bytes for string constants?
IIRC, gcc defaults to interpreting source files using the encoding for the locale it's in. That is going be UTF-8 for Mac OS and modern Linux desktop. The other half that is what encoding the text editor uses. It most likely is also UTF-8.
>
> matthew
>
> On 30/08/2013 3:56 PM, Matthew Ford wrote:
>>
>> I have working on displaying non-ASCII chars on my Android app, pfodApp.
>> So that users can control Arduino devices using their own Language.
>> The basic approach is to store the UTF-8 bytes in an array and send them to the pfodApp for display.
>>
>> However I on testing I noticed that I can paste Italian accented characters directly into the IDE in a " " (string) and they are correctly sent and displayed by the pfodApp which is expecting UTF-8.
>>
>> My question is what mult-language support is already provided by the IDE and the compiler?
>> Does it handle Chinese, Greek, etc?
>>
>> matthew
>>
>>
>
On Aug 31, 2013 6:59 AM, "Cristian Maglie" <c.ma...@bug.st> wrote:
>
> In data sabato 31 agosto 2013 15:31:07, Matthew Ford ha scritto:
> > No comments on this so far.
> > Could it be that the IDE saves the sketch in UTF-8 format and that as a
> > result the gcc compiler gets the UTF-8 bytes for string constants?
I am less well versed with C++, but I know how C89 does it. There is a source encoding and a machine (binary) encoding for string contents. They are not always the same. Source files are parsed as characters in some source encoding (originally in either an ASCII or an EBCDIC encoding variant) and any non-control character excluding backslash and double quote can be included in a string literal verbatim and will be converted to the machine encoding when complied to an object file (machine form). For standard GCC on modern Linux systems, the machine encoding of any string literal is UTF-8, but the source file encoding is selected based on the current locale. For portability, it's common to specify non-ASCII literals as an escape like \u2182. This removes any dependence on the current locale or compiler. I expect AVR GCC has the same defaults. Both encodings can be changed with command-line options to GCC.
Note, this is completely different from wide string literals in C which are written with a capital L in front of quotation marks and use the base type wchar_t. That is a 32-bit (formerly 16-bit) integer as opposed to the standard 8-bit char used for normal C strings. Wide strings are always stored in UTF-32 encoding and that can't be changed.
>
> Hi Matthew,
>
> the IDE uses a JEditTextArea whose methods getText(..) and setText(..) uses a
> java String to retrieve/store the editor content.
> Since java strings are UTF8, I would say yes, the compiler receive an UTF-8
> file as input.
>
> But, and this is what matters, I didn't know is if the g++ compiler can handle
> such strings literal correctly. I did a quick search, and It seems that the
> compiler behaviour is undefined for non-ascii string. C++11 added an "u8"
> keyword to force UTF8 literals like:
>
> const char[] str = u8"Test String";
>
> but it didn't work on avr-gcc, even if I try to use the compiler option "-
> std=c++0x"
>
> http://stackoverflow.com/questions/13748068/gcc-utf-8-string-literal-compile-
> error
> http://stackoverflow.com/questions/13444930/is-the-u8-string-literal-necessary-
> in-c11
> http://stackoverflow.com/questions/14679717/c11-example-of-difference-between-
> ordinary-string-literal-and-utf-8-string-li
>
> C
>
Thanks every one for the info.
I did not really think it was as simple as I proposed.
Some notes
the IDE uses a JEditTextArea whose methods getText(..) and setText(..) uses a java String to retrieve/store the editor content.
Since java strings are UTF8, I would say yes, the compiler receive an UTF-8 file as input.
The Java spec says
"The Java programming language represents text in sequences of 16-bit code units, using the UTF-16 encoding."
so internally to the java program the encoding is NOT UTF-8 so it would seem that it depends on how the source file is written and then read by the C++ compiler.
email to developers+unsubscribe@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
Hi Loren,Java will not save in UTF-8 by default. By default Java saves in the 'default' local encoding.
The actual encoding that C/C++/Wiring source files are saved in is UTF-8
which I have confirmed using Arduino 1.0.5. Here is my sample sketch:
If we want the IDE to ALWAYS save in UTF-8, it needs to explicitly specified as the encoding in the source code if the IDE.
I did a quick check of the IDE source code and could not find any case where anything other then the 'default' character encoding is used.
If you run the IDE on an OS that does not have UTF-8 as the default encoding you will not get UTF-8 files.
gcc will still work because it, also, uses the 'default' encoding to read the files.
BUT if you download the sketch to another OS all bets are off.
To an IDE user the underlying C/C++ IS Arduino. They have no knowledge of the magic that makes their sketch into a loadable file, and should not be expected to.
but that is an issue inherent with C/C++, not Arduino or GCC.
That is the main selling point of Arduino. Arduino hides the C/C++, and micro assembler, under an IDE with a simplified programming interface and set of programming statements.
Testing back to your own terminal is not a valid test as the sketch is being run on the same OS/local that created it.
If I downloaded that sketch (or a library) on some other machine, what would happen?
Internationalisation means a consistent experience over various OS/locals.
I think this issue of using non-ASCII characters for display purposes, such as when coding http servers, needs to more precisely defined or documented.
Given that Arduino originated in Italy, which uses some accented chars that are outside the 7bit ASCII range, I am surprised this was not done from the start.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
-finput-charset=charseticonv library routine. -finput-charset=UTF-8--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.