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
Power Lifting Lever Belt
SkullVamp
Updated:
Yesterday at 10:32 PM
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Yesterday at 3:55 PM
Colombo
Kaduwela - Two Storey House for Sale
dilrasan
Updated:
Thursday at 2:23 PM
Ad icon
Wechat qr verification
Pawan2005
Updated:
Thursday at 1:28 AM
🚀 GOOGLE AI PRO 18 MONTHS ACTIVATION 🚀
sayuru bandara
Updated:
Wednesday at 5:34 PM
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
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom