Categories

Character Comparison Problem – Python

I realized in some part of a program of mine following statements print False:

#coding = utf-8
turkishConsonants = ['b', 'c', 'ç', 'd','f','g','ğ','h','j','k','l','m',
'n','p','r','s','ş','t','v','y','z']
word = “ağla”
print word[-3] in turkishConsonants

The reason for this was the letter ‘ğ’ is stored as two array elements and word[-3] returns only half of it.
Proper way to make comparison is [...]

Setting Java Character Encoding

When operations on different character sets need to be done in Java, we need to initialize JVM with required options.

First lets have a look at basics of java character encodings.

Internally the JVM always operates with Unicode.
Data transferred in or out of the JVM is converted to a format specified in the file.encoding property of the [...]