unicode

Is it possible to write a great PHP app which uses Unicode?

My next web application project will make extensive use of Unicode. I usually use PHP and CodeIgniter however Unicode is not one of PHP's strong points. Is there a PHP tool out there that can help me get Unicode working well in PHP? Or should I take the opportunity to look into alternatives such as Python? ...

Proper JSON formatting a C# String

If you do this in MVC: var jsonData = new { myimage = "<img alt=\"\" src=\"/Content/images/ShowFPots.png\" />" }; return Json(jsonData); You get this as a value "\u003cimg alt=\"\" src=\"/Content/images/ShowFPots.png\" /\u003e" How do I get this as a value, or will the <> interpret correctly when I add them to the in...

Typographic apostrophe + wide string literal broke my wofstream (C++)

I’ve just encountered some strange behaviour when dealing with the ominous typographic apostrophe ( ’ ) – not the typewriter apostrophe ( ' ). Used with wide string literal, the apostrophe breaks wofstream. This code works ofstream file("test.txt"); file << "A’B" ; file.close(); ==> A’B This code works wofstream file("test.txt"); f...

Where is Python's "best ASCII for this Unicode" database?

I have some text that uses Unicode punctuation, like left double quote, right single quote for apostrophe, and so on, and I need it in ASCII. Does Python have a database of these characters with obvious ASCII substitutes so I can do better than turning them all into "?" ? ...

Is there a way to correctly sort unicode strings in SQLite using Python?

Is there a simple way to order rows with unicode data in SQLite? ...

NHibernate won't decode UTF-8 from MySql

Hey, I have populated a MySQL table with utf-8 strings (using a python script). You can assume that the string in the DB was correctly encoded (I've verified this by extracting the string from MySQL Query Browser and running a utf-8 decode... got my original unicode string). Now the problem begins when I try to load this string using N...

rules for slugs and unicode

After researching a bit how the different way people slugify titles, I've noticed that it's often missing how to deal with non english titles. url encoding is very restrictive. See http://www.blooberry.com/indexdot/html/topics/urlencoding.htm So, for example how do folks deal with for title slugs for things like "Una lágrima cayó en l...

Modifying C++ DLL to support unicode - common pitfalls to avoid?

I have a windows DLL that currently only supports ASCII and I need to update it to work with Unicode strings. This DLL currently uses char* strings in a number of places, along with making a number of ASCII Windows API calls (like GetWindowTextA, RegQueryValueExA, CreateFileA, etc). I want to switch to using the unicode/ascii macros de...

How to open an std::fstream (ofstream or ifstream) with a unicode filename ?

You wouldn't imagine something as basic as opening a file using the C++ standard library for a Windows application was tricky ... but it appears to be. By Unicode here I mean UTF-8, but I can convert to UTF-16 or whatever, the point is getting an ofstream instance from a Unicode filename. Before I hack up my own solution, is there a pref...

Where does glibc get its database of unicode attributes?

Where does glibc get its database of unicode attributes, for such functions as eg, wcwidth()? I'm interested in correcting a few errant entries, but I can't seem to find where this information is in its source distribution. If it matters, I'm primarily interested in this under debian or ubuntu linux. ...

Should my python web app use unicode for all strings?

I see some frameworks like Django using unicode all over the place so it seems like it might be a good idea. On the other hand, it seems like a big pain to have all these extra 'u's floating around everywhere. What will be a problem if I don't do this? Are there any issues that will come up if I do do this? I'm using Pylons right no...

SQLGetDiagRec causes crash in Unicode release build

I'm having a problem with the call to SQLGetDiagRec. It works fine in ascii mode, but in unicode it causes our app to crash, and i just can't see why. All the documentation i've been able to find seems to indicate that it should handle the ascii/unicode switch internally. The code i'm using is: void clImportODBCFileTask::get_sqlError...

What DVCS support Unicode filenames?

I'm interested in trying out distributed version control systems. git sounds promising, but I saw a note somewhere for the Windows port of git that says "don't use non-ASCII filenames". I can't find that now, but there is this link. It's put me off git for now, but I don't know if the other options are any better. Support for non-ASCII ...

How do I escape a Unicode character in my source code?

I feel incredibly stupid for asking this, but the documentation and Google are giving me no love at all. I have a Unicode character I want to insert into a string literal in the source code of my iPhone app. I know its hex value. What is the proper escape sequence to use? And for that matter, what obvious source of information am I o...

C++ unicode question

I'm aware of ICU and small libraries like the utf8 one on code project (forget the exact name) however none of these are exactly what I want. What I really want is something like ICU but wrapped up in a more friendly manner. Specifically: Fully Object Orientated Implementations of the c++ standard streams, or at least something tha...

Migrating Delphi DFM's with special characters to D2009

I've got a number of Delphi forms where we use a couple of special characters - the 'degree' symbol, and the 'ohms' symbol. These characters are used in label captions saved in the DFM file and are not generated or modified at runtime. Back along when we first designed these forms the degree symbol was easy because it is in the Ansi char...

how to use list of python objects whose representation is unicode

I have a object which contains unicode data and I want to use that in its representaion e.g. # -*- coding: utf-8 -*- class A(object): def __unicode__(self): return u"©au" def __repr__(self): return unicode(self).encode("utf-8") __str__ = __repr__ a = A() s1 = u"%s"%a # works #s2 = u"%s"%[a] # gives un...

Can I use Unicode to decode an HTTP request?

I understand that the default encoding of an HTTP Request is ISO 8859-1. Am I able to use Unicode to decode an HTTP request given as a byte array? If not, how would I decode such a request in C#? EDIT: I'm developing a server, not a client. ...

Rename invalid filename in XP via Python

My problem is similar to http://stackoverflow.com/questions/497233/pythons-os-path-choking-on-hebrew-filenames however, I don't know the original encoding of the filename I need to rename (unlike the other post he knew it was Hebrew originally). I was doing data recovery for a client and copied over the files to my XP SP3 machine, and ...

HTML/ASPX textbox to store non-english characters to SQL database

I have this textbox on an .aspx page, which when submitted it stores whatever typed in the textbox into a nvarchar column in MS SQL 2005. It works fine, until you try putting chinese characters. These characters are converted to question marks (?) in the database. How do you store non-english characters from a <input type="text"> to da...