www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - openquran v0.21

reply "Aziz K." <aziz.kerim gmail.com> writes:
Some people here might really wonder what the heck I was thinking of when  
I wrote this program. To me it's pretty useful in debates with Muslims  
when I just want to quickly look up a single verse or a list of verses  
 from the Qur'an. You can even search the 3 translations I included using  
regular expressions and fuzzy word matching. It will probably be not very  
useful to the majority here, but hey it's my first open source project and  
it was such a pleasure to write it in D. And I think the more people are  
exposed to working D programs, the more people will get interested in the  
language.

There is one issue I just couldn't find a quick solution to. With some  
tweaks it's possible to output utf-8 on the Windows console (chcp 65001),  
but there seems to be a bug in the streams implementation of DMD. If I  
output something like writefln("äüö"); everything that comes afterwards is  
cut off (the condition being that the font Luicida Sans Console is set and  
chcp 65001 was executed.) To circumvent this problem for the time being I  
included a batch file which streams the output to a file first and then  
calls "type tmp" to display its contents in the console window. At the  
moment this problem only affects the main help message which isn't shown  
fully because my name contains a "ö". This will also be a problem when I  
add non-English translations in the future (the 3 ones I included are all  
in English.)

http://code.google.com/p/openquran/
http://code.google.com/p/openquran/downloads/list

Oh and before I forget it, thanks Walter for saving me from the horrible  
C/C++ hell!

PS.: I compiled the Windows binary on Linux using wine-0.9.36 and the  
Windows version of DMD. It should work, I tested it on WinXP once.
May 07 2007
next sibling parent Tom <tom nospam.com> writes:
Aziz K. escribió:
 There is one issue I just couldn't find a quick solution to. With some 
 tweaks it's possible to output utf-8 on the Windows console (chcp 
 65001), but there seems to be a bug in the streams implementation of 
 DMD. If I output something like writefln("äüö"); everything that comes 
 afterwards is cut off (the condition being that the font Luicida Sans 
 Console is set and chcp 65001 was executed.) 

I've noted this myself. My solution was to avoid using accented characters. In the real world, this would have been a terrible solution <g>. So, is this a bug?? Tom; (Tomás Rossi)
May 07 2007
prev sibling next sibling parent reply Lutger <lutger.blijdestijn gmail.com> writes:
This is useful, thank you very much.
May 08 2007
parent "Aziz K." <aziz.kerim gmail.com> writes:
 This is useful, thank you very much.

Thank you, too. I would have never imagined that this might be actually useful to somebody here :P
May 08 2007
prev sibling next sibling parent "Aziz K." <aziz.kerim gmail.com> writes:
Seems like that batch file is a bit buggy and has Unix newlines instead of  
Windows newlines. No wonder, I wrote it in Linux :P. I booted into Windows  
today and tried to fix it, but no luck the Windows console is really a  
total piece of crap. I tried all sorts of mental acrobatics to make it  
work, but it seems Windows can't provide the right environment for my  
project. Well, at the moment only English translations are supported, but  
if I add other languages I guess my dear Windows users have to make do  
with insufficient UTF-8 support and look at funny garbled characters.

Anyway, I hope I can write a GUI as soon as possible. I'm currently  
looking at Gecko, because it has so fantastic support for composing a user  
interface using XML files. I like the idea about how powerful this is in  
combination with CSS. What scares me a little bit is this XPCOM stuff. Has  
anybody come up with a compilable example of an XPCOM module written in D  
yet? I'd really much appreciate it if somebody could post some code here  
if s/he managed doing that.

Regards.
May 08 2007
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Aziz K. wrote:
 There is one issue I just couldn't find a quick solution to. With some 
 tweaks it's possible to output utf-8 on the Windows console (chcp 
 65001), but there seems to be a bug in the streams implementation of 
 DMD. If I output something like writefln("äüö"); everything that comes 
 afterwards is cut off (the condition being that the font Luicida Sans 
 Console is set and chcp 65001 was executed.)

Make sure the D source code is in UTF-8, and any text it reads from a file is in UTF-8.
May 08 2007
parent reply "Aziz K." <aziz.kerim gmail.com> writes:
On Tue, 08 May 2007 20:23:10 +0200, Walter Bright  
<newshound1 digitalmars.com> wrote:

 Make sure the D source code is in UTF-8, and any text it reads from a  
 file is in UTF-8.

I'm pretty sure all the source code is in UTF-8. I used kate as my editor and it always defaults to UTF-8. Besides shouldn't the compiler complain if the source code has illegal characters? I talked about this problem in the IRC channel and a user was able to reproduce the problem. Weren't you able to reproduce it?
May 08 2007
parent Walter Bright <newshound1 digitalmars.com> writes:
Aziz K. wrote:
 I'm pretty sure all the source code is in UTF-8. I used kate as my 
 editor and it always defaults to UTF-8. Besides shouldn't the compiler 
 complain if the source code has illegal characters? I talked about this 
 problem in the IRC channel and a user was able to reproduce the problem. 
 Weren't you able to reproduce it?

I didn't try to reproduce it, but often these types of problems are because there's non-UTF-8 encodings somewhere in the process.
May 08 2007