• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[#Red] Red language group

DocKimbel
26-Sep-2012
[2171x2]
Ah, found an HowTo: http://stackoverflow.com/questions/3780378/how-to-display-japanese-kanji-inside-a-cmd-window-under-windows
And now Red speaks Chinese too: http://static.red-lang.org/hello_unicode3.png
GrahamC
26-Sep-2012
[2173]
lol
Henrik
26-Sep-2012
[2174]
Doc, does it also work in source code or only printed strings?
DocKimbel
26-Sep-2012
[2175x2]
Henrik: look better at the screenshot. ;-)
(I've put the source of hello.red behind the console window)
GrahamC
26-Sep-2012
[2177]
Probably violates rules for legal variable names
DocKimbel
26-Sep-2012
[2178]
You can use any Unicode character in your Red words.
GrahamC
26-Sep-2012
[2179]
Hello World in Chinese should probably be .. world hello and not 
hello world
DocKimbel
26-Sep-2012
[2180]
I don't know Chinese, so I just took the string Jerry gave me.
GrahamC
26-Sep-2012
[2181]
You'll have to change your print string :)
Pekr
26-Sep-2012
[2182x2]
I don't get any chars for Chinese, and in the Greek string third 
char is incorrect too ...
font I use is Lucida Console ...
Henrik
26-Sep-2012
[2184]
You can use any Unicode character in your Red words.

 - ok, that was what I was looking for, as R3 can do this. Thanks.
Jerry
26-Sep-2012
[2185]
Graham is right, In Chinese, "World Hello" is better than "Hello 
World". You can change it if you want, Doc. :-) But I saw other langauge, 
such as Falcon, use "Hello World" in Chinese to demo their unicode 
support.
DocKimbel
26-Sep-2012
[2186x2]
Pekr: switch to Consolas which has the best range of Unicode glyphs 
support.
(you won't be able to display CJK anyway though)
Pekr
26-Sep-2012
[2188x3]
I can select only two fonts there - raster, or Consolas ....
btw - Czeh version of hello world does not display any character 
correctly :-)
dunno if bug, or I should somehow adapt font, anything else, etc.
PeterWood
26-Sep-2012
[2191]
Is the source file of your Czech version UTF-8 encoded?
DocKimbel
26-Sep-2012
[2192x3]
Third greek character incorrect
: be sure you're using latest revision.
Pekr: try typing your Czech characters in Notepad (it has excellent 
Unicode support).
(just select UTF-8 when saving)
Pekr
26-Sep-2012
[2195x2]
hello.red is already UTF-8, I just added one line and saved ...
going to lunch, willing to debug, if I can get any instructions ....
DocKimbel
26-Sep-2012
[2197x2]
Be sure you've saved it in UTF-8.
Anyway, we need more people testing Unicode support for Windows console, 
just in case we missed something.
Pekr
26-Sep-2012
[2199]
well, anyway - how is R2 being able to read utf-8 anyway?
DocKimbel
26-Sep-2012
[2200]
It reads it as a stream of bytes. As UTF-8 doesn't use null bytes 
in its encoding (except for codepoint 0), it can be fully loaded 
as string! or binary! in R2 (but you'll see garbage for non-ASCII 
characters).
PeterWood
26-Sep-2012
[2201]
If anybody can provide the UTF-8 chars (hex values)  for Hello World 
in Czech. I'll run a test.
DocKimbel
26-Sep-2012
[2202x3]
Peter: should be "Dobr^(C3)^(BD) den sv^(C4)^(9B)t"
I've just tested it on Windows console (using Consolas font), it 
works fine.
The above string doesn't work as-is in Red though, you should pass 
the codepoints escaped instead of the UTF-8 encoding.
PeterWood
26-Sep-2012
[2205]
I noticed :-)
DocKimbel
26-Sep-2012
[2206]
I haven't implemented full char! support yet, so I can't write a 
Red script to print me the right codepoint values...(char! will be 
implemented later today though).
Jerry
26-Sep-2012
[2207]
Hello

 in many languages http://www.omniglot.com/language/phrases/hello.htm
DocKimbel
26-Sep-2012
[2208x2]
Good source, even Klingon is there! :-)
Hello in Klingon:

nuqneH (What do you want?)
- used when confronted by another
PeterWood
26-Sep-2012
[2210]
Code points are 00FD & 011B
DocKimbel
26-Sep-2012
[2211x2]
I really need to learn more, my Klingon is currently limited to " 
Qapla' " only (means Goodbye).
Thanks Peter. It works for me with "Dobr^(FD) den sv^(011B)t"
Pekr
26-Sep-2012
[2213]
Above works ... but when I write it directly in Notepad (and the 
file claims it is UTF-8), it does not work ... strange then ...
Henrik
26-Sep-2012
[2214]
Not sure if Notepad is the best for UTF-8 work...
DocKimbel
26-Sep-2012
[2215x3]
Pekr: it might be a BOM issue with Red loader, I don't remember testing 
it...
Pekr: try to set the "encoding" field to UTF-8 in the saving panel 
(Save as...).
Here, I have no issue using Notepad to write Red Unicode scripts.
Pekr
26-Sep-2012
[2218]
it is set to UTF-8 already ....
DocKimbel
26-Sep-2012
[2219]
You can still download Notepad++ (or any other text editor with decent 
Unicode support). I have to drop my good old TextPad as it doesn't 
have good Unicode support.
Pekr
26-Sep-2012
[2220]
I will do some more testing later ...