unicode

Hashing JSON in PHP does not produce the same result as in Javascript for unicode characters

Hey! My web application communicates with the server over JSON protocol. Before sending each JSON message from the web application, I run a hmac-sha1 function on it (on already encoded object) and insert the resulting HMAC into the header of JSON request. On server side, I decode JSON message with PHP, extract the HMAC, unset() the HMA...

wfstream not writing

I have the following piece of code in C++: #include <iostream> #include <fstream> #include <string> using namespace std; int main(){ wstring ws1 = L"Infinity: \u2210"; wstring ws2 = L"Euro: €"; wchar_t w[] = L"Sterling Pound: £"; wfstream out("/tmp/unicode.txt"); out.write(ws1.c_str(), ws1.size()); out << ws1...

Decoding if it's not unicode

I want my function to take an argument that could be an unicode object or a utf-8 encoded string. Inside my function, I want to convert the argument to unicode. I have something like this: def myfunction(text): if not isinstance(text, unicode): text = unicode(text, 'utf-8') ... Is it possible to avoid the use of isins...

Unicode character in octets to hexadecimal

Unicode character in octets is something like 110xxxxx 10xxxxxx. How can I transform these octets in hexadecimal notation like U+XXXX? ...

Insert Unicode chars to MySQL with Delphi 2010

Trying to insert values with Unicode Chars into a MySQL-database using Delphi 2010 and TADOConnection with no luck. Connection with ODBC Provider=MSDASQL.1;Persist Security Info=False;Data Source=mysrc;Initial Catalog=mydb The SQL command: INSERT INTO myTable (aCol) VALUES('Russian: русский язык') Tried inserting it directly with...

why i can't use \u000D and \u000A as CR and LF in java

why i can't use \u000D and \u000A as CR and LF in java. Its giving an error illegal line end in character literal when i compile the code ...

problem with WHERE clause matching on Arabic string

I have a SQL Server 2005 database in which I have some tables contain Arabic text. The datatype for those fields is NVARCHAR(n). The Arabic text inside the table is appearing properly, and when selecting, they appear properly. Th problem is that searching for Arabic text results in 0 rows. select * from table_name where name='arabic_...

Problem converting char to wchar_t (length wrong)

I am trying to create a simple datastructure that will make it easy to convert back and forth between ASCII strings and Unicode strings. My issue is that the length returned by the function mbstowcs is correct but the length returned by the function wcslen, on the newly created wchar_t string, is not. Am I missing something here? typed...

how to decode a non unicode character in python?

I have a string say s = 'Chocolate Moelleux-M\xe8re' When i am doing: In [14]: unicode(s) --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 20: ordinal not in range(1...

How to insert Indian Rupees Symbol in Database (Oracle 10g, MySql 5.0 and Sql Server 2008)?

How to insert Indian Rupees Symbol in Database (Oracle 10g, MySql 5.0 and Sql Server 2008)? Actually i had one Table "Currency" , in which 2 field is like "currencyName" and "currencysymbol", so how would i insert new rupees symbol in databse. ...

How to: remove part of a Unicode string in Python following a special character

Hi all first a short summery: python ver: 3.1 system: Linux (Ubuntu) I am trying to do some data retrieval through Python and BeautifulSoup. Unfortunately some of the tables I am trying to process contains cells where the following text string exists: 789.82 ± 10.28 For this i to work i need two things: How do i handle "weird" sym...

utf-8 file displays doubled characters

A generated utf-8 file displays properly in the terminal: but not in Firefox or gedit: It looks like the characters are doubled with weird ones? The file: http://maestric.com/shared/other/2004_10_14.txt Any idea on what is wrong with it? ...

Unicode string mess in perl

I have an external module, that is returning me some strings. I am not sure how are the strings returned, exactly. I don't really know, how Unicode strings work and why. The module should return, for example, the Czech word "být", meaning "to be". (If you cannot see the second letter - it should look like this.) If I display the string,...

send unicode sms message

Hello friends I need to send a SMS message using the AT commands through a GSM mobile (Nokia 6320) with (text mode) using C# with .NET platform, the message that i want to send it is written in Arabic language (unicode), i have some problems in tranmission so that the recieved message does'nt contain arabic letters but contains only ran...

C# char/byte encoding equality

I have some code to dump strings to stdout to check their encoding, it looks like this: private void DumpString(string s) { System.Console.Write("{0}: ", s); foreach (byte b in s) { System.Console.Write("{0}({1}) ", (char)b, b.ToString("x2")); } System.Console.Writ...

Chemical symbol support on a textbox

I am developing an application that needs some kind of subscript and superscript support to display text that refers to chemical formula, if I do it in a textbox (winforms) and want for example show water formula, it would appear as H20 rather than H(subscript 2)O (sorry I coudn't find how to do it here). How could this be done? Thanks. ...

Are there any situations in which you would use NLS_LENGTH_SEMANTICS=BYTE on a Unicode database?

Having a Unicode (multi-byte charset) Oracle database with NLS_LENGTH_SEMANTICS=BYTE seems like a disaster waiting to happen. Field validation in most applications only check the number of characters is within bounds, not the byte sequence length in the database’s default character encoding scheme! If you've got a Unicode database, is th...

How do I stop a stored procedure or ASP page from corrupted unicode strings?

I have a database that has already corrupted unicode strings, now on my ASP page, they are shown as "?" marks. Is there a way either to stop them from being returned down at the stored procedure level? or is the best way to stop them from showing up on the asp page is to somehow detect the corrupted unicode strings and stop them from bei...

stristr problem with unicode string

I use mb_stristr function to detect whether a word exists in string or not but if the word I'm checking for is written in unicode this function always returns false. Even if the word actually exists. If I'm looking for non unicode word it word it works fine. Does anyone know how to solve this problem? Tried the strstr function too but th...

Soap Envelope Header in Delphi 7 not including utf-8 encoding. How can I modify it?

I'm having problems receiving invalid non-ascii characters coming from a Delphi 7 client sending a utf-8 encoded XML to a C# WebService in a String parameter. With a .Net client, the characters are received without a problem. I've tried a lot of stuff, and nothing seemed to work, so I decided to trace the SOAP conversation with Wireshark...