Showing posts with label Unicode. Show all posts
Showing posts with label Unicode. Show all posts

Monday, June 25, 2018

How do you print a Kannda (South Indian Language) word in Python using UTF-8?

Kannada (South Indian language) characters have the Unicode range from 0C80-0CCF 

UTF-8 is Python's default encoding.


 Let us take a simple word:
ಕಲಹ
Which means 'quarrel'. The letters are simple and you could use their Unicode equivalents
using this chunk of code block.

To form the word we concatenate the characters as shown,



What about a word such as this, ಅರಮನೆ? (means Palace)
The first three letters are simple but the fourth letter is a rendering with a diacritic of a simple letter 'ನ'. The fourth letter requires concatenating the two shown above:

In order to form the word ಅರಮನೆ we need to do the following:




Tuesday, December 19, 2017

Can you import Arabic characters into a table using R?

I tried this simple example. I do not know Arabic but I created this 3x2 table and tried to get it into a variable in R. Looks like I succeeded. I think these are
Unicode (https://unicode-table.com/en/search/?q=U%2B0648) characters for the Arabic characters.

Now I request my Arabic readers to help me if this makes sense.


The first row translates to the following:



You may reply to: hodentek@live.com

Tuesday, October 27, 2015

How do you use the PHP Explode function?

This post describes some examples run on a Windows 10's Internet Information Services. This is relevant for PHP 4 and PHP 5.


First directly from documentation:
array explode ( string $delimiter , string $string [, int $limit ] )

Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter.


Parameters ¶

delimiter

The boundary string.

string

The input string.

limit


If limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string.

If the limit parameter is negative, all components except the last -limit are returned.

If the limit parameter is zero, then this is treated as 1.

Here is an example PHP file (a text file saved with the extension php) in the root directory (wwwroot) of Inetpub on a computer running Windows 10.
============
explodephp.php
============


Explode Function


$str="A thing of beauty, is a joy for ever!";
print_r(explode(" ",$str));
?>

-----------------
At first the file should not be saved to wwwroot with extension txt, it must be php

In the SaveAs window it can he saved as ANSI, Unicode, UTF-8 or Unicode Big Endian - you have to choose the correct one.

In the first position of the explode() function you need to choose the delimiter which can be, space, comma, etc and then the $str variable is to be set.

Here are some examples with parsed content. If there is no response as in some examples here, a FALSE is returned. Also if a delimiter is not present, the whole string is returned.


Parsing a string in Japanese