Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Yesterday at 12:26 PM
Windows RDP Only Rs.500 a month
Blogerwiki
Updated:
Sunday at 12:41 PM
Ad icon
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 2026
FREE SEO Check & Google Maps Check for Sri Lankan Businesses | Web Design, Website Price Rs 14,900 |
LankaSolve
Updated:
Oct 20, 2026
ඕනම රටකට සෙට් වෙන CV එකක්
ErMurazor
Updated:
Oct 17, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Need help with Sinhala Unicode and C programming
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Safari7" data-source="post: 16606764" data-attributes="member: 502608"><p>I can print sinhala words to the console. But can't print letter by letter! </p><p></p><p>This prints the word correctly to the console:</p><p></p><p>[CODE]char *word = "අලංකෘත";</p><p> </p><p> // print the word</p><p> printf("%s\n",word);[/CODE]</p><p></p><p></p><p>But the below code doesn't print characters correctly.</p><p></p><p>[CODE]char *word = "අලංකෘත";</p><p> </p><p> // print letter by letter</p><p> int n = sizeof(word) / sizeof(word[0]);</p><p> </p><p> for (int i = 0; i < n; i++) {</p><p> printf("%c\n", word[i]);</p><p> }[/CODE]</p><p></p><p>I get the following output from the above code.</p><p></p><p>[CODE]\340</p><p>\266</p><p>\205</p><p>\340</p><p>\266</p><p>\275</p><p>\340</p><p>\266</p><p>[/CODE]</p><p></p><p></p><p>My goal is to read a text file that has a large number of sinhala words and convert them to equivalent phonetic english words. For this, I need to compare letters in the sinhala unicode word. So that means I need a way to read letter by letter.</p><p></p><p>I know a very little about Unicode stuff. So any tip/advice would be much appreciated!</p></blockquote><p></p>
[QUOTE="Safari7, post: 16606764, member: 502608"] I can print sinhala words to the console. But can't print letter by letter! This prints the word correctly to the console: [CODE]char *word = "අලංකෘත"; // print the word printf("%s\n",word);[/CODE] But the below code doesn't print characters correctly. [CODE]char *word = "අලංකෘත"; // print letter by letter int n = sizeof(word) / sizeof(word[0]); for (int i = 0; i < n; i++) { printf("%c\n", word[i]); }[/CODE] I get the following output from the above code. [CODE]\340 \266 \205 \340 \266 \275 \340 \266 [/CODE] My goal is to read a text file that has a large number of sinhala words and convert them to equivalent phonetic english words. For this, I need to compare letters in the sinhala unicode word. So that means I need a way to read letter by letter. I know a very little about Unicode stuff. So any tip/advice would be much appreciated! [/QUOTE]
Insert quotes…
Verification
Hathara warak wissa keeyada? (Hathara wadi karanna 20)
Post reply
Top
Bottom