<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Create a list of all hebrew characters and dereference the list according to the index of the character. <br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
const char **alefbet = { <br> "\327\220", <br> "\327\221",<br> :<br>}<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">printf("%s\n", alefbet[index]); // For index in 0..26 <br>
<br>Am I missing something?<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dov<br><br></div><div style id="divCleekiAttrib"></div><div style id="divCleekiAttrib"></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Jan 12, 2014 at 9:29 PM, Ori Idan <span dir="ltr"><<a href="mailto:ori@helicontech.co.il" target="_blank">ori@helicontech.co.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Sun, Jan 12, 2014 at 9:26 PM, Dov Grobgeld <span dir="ltr"><<a href="mailto:dov.grobgeld@gmail.com" target="_blank">dov.grobgeld@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">The most unixy way is to treat everything as binary UTF-8 and then forget about encodings. The following program works just fine:<br>
<br><pre><span style="color:rgb(72,61,139)">#include</span> <span style="color:rgb(0,139,0)"><stdio.h></span>
<span style="color:rgb(34,139,34)">int</span> <span style="color:rgb(0,0,255)">main</span>()
{
printf(<span style="color:rgb(0,139,0)">"Hello שלום!\n"</span>);
}<br><br></pre><pre>Compile with:<br><br>cc -o hello hello.c
./hello<br>Hello שלום!<br><br></pre>(Though שלום is inversed in the terminal).<br></div></div></blockquote><div><br></div></div><div>That works, but I need one character such as 'א' to be printed and to be able to print 'ב' as 'א' + 1</div>
<div>Does someone have any idea how to do it?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Ori Idan</div></font></span><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="font-family:arial,helvetica,sans-serif"><br><br></div><div></div><div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div>
On Sun, Jan 12, 2014 at 9:02 PM, Baruch Siach <span dir="ltr"><<a href="mailto:baruch@tkos.co.il" target="_blank">baruch@tkos.co.il</a>></span> wrote:<br></div><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Dov,<br>
<div><br>
On Sun, Jan 12, 2014 at 08:53:38PM +0200, Dov Grobgeld wrote:<br>
> Writing hebrew to the terminal is a bad idea because terminals do not<br>
> support BiDi reordering.<br>
><br>
> That said, doing "cat small-hello.utf8"[1] works for me in gnome-term<br>
> (though it is reversed). No special environment variables were defined.<br>
<br>
</div>But Ori has specifically asked about sending just one character to terminal.<br>
cat treats everything like binary data.<br>
<br>
baruch<br>
<div><div><br>
> On Sun, Jan 12, 2014 at 8:34 PM, Ori Idan <<a href="mailto:ori@helicontech.co.il" target="_blank">ori@helicontech.co.il</a>> wrote:<br>
> > I need to print several Hebrew characters (UTF-8) to the terminal.<br>
> > My locale is set to he_IL.UTF-8 so it shows Hebrew on the terminal,<br>
> > however printing from C gives me Chinese characters.<br>
> > My question is how to print one character such as 'א' to the terminal.<br>
> ><br>
> > --<br>
> > Ori Idan<br>
<br>
</div></div><span><font color="#888888">--<br>
<a href="http://baruch.siach.name/blog/" target="_blank">http://baruch.siach.name/blog/</a> ~. .~ Tk Open Systems<br>
=}------------------------------------------------ooO--U--Ooo------------{=<br>
- <a href="mailto:baruch@tkos.co.il" target="_blank">baruch@tkos.co.il</a> - tel: <a href="tel:%2B972.2.679.5364" value="+97226795364" target="_blank">+972.2.679.5364</a>, <a href="http://www.tkos.co.il" target="_blank">http://www.tkos.co.il</a> -<br>
</font></span></blockquote></div></div></div><br></div>
</blockquote></div></div><br></div></div>
</blockquote></div><br></div>