unicode

JQuery AJAX Call with Unicode. Proper way to POST Unicode data?

I have page that POSTS AJAX to the server, and often the data will be Unicode. This works most the time, but it appears that sometimes it's breaking and I'm can't seem to find the answer anywhere. I have been using encodeURI, but I'm not sure that's correct. Here's a example of the code: $.ajax({ type: "POST", url: ...

Enable Unicode "globally" in Python

is it possible to avoid having to put this in every page? # -*- coding: utf-8 -*- I'd really like Python to default to this. Thanks in advance! ...

Why do I get the u"xyz" format when I print a list of unicode strings in Python?

Please observe the following behavior: a = u"foo" b = u"b\xe1r" # \xe1 is an 'a' with an accent s = [a, b] print a, b print s for x in s: print x, The result is: foo bár [u'foo', u'b\xe1r'] foo bár When I just print the two values sitting in variables a and b, I get what I expect; when I put the string values in a list and print...

Is there a UnicodeCategory Enumeration diagram?

I looking for a good UnicodeCategory Enumeration diagram that show an example to each one. ...

MonoTouch Comparing Strings

I have an app which lists many languages. In the app I compare language names. When I compare language names with no accents it works and the compare is true. When I compare languages with accents, it doesn't think they are equal. In this case they are NOT equal (but should be). Language = "Español"; MonoTouch.Foundation.NSString s =...

utf-8 to/from utf-16 problem

I based these two conversion functions and an answer on StackOverflow, but converting back-and-forth doesn't work: std::wstring MultiByteToWideString(const char* szSrc) { unsigned int iSizeOfStr = MultiByteToWideChar(CP_ACP, 0, szSrc, -1, NULL, 0); wchar_t* wszTgt = new wchar_t[iSizeOfStr]; if(!wszTgt) assert(0); Mult...

Batch script is not executed if chcp was called

Hello! I'm trying to delete some files with unicode characters in them with batch script (it's a requirement). So I run cmd and execute: > chcp 65001 Effectively setting codepage to UTF-8. And it works: D:\temp\1>dir Volume in drive D has no label. Volume Serial Number is 8C33-61BF Directory of D:\temp\1 02.02.2010 09:31 <D...

Unicode symbols (arrows) in Java

i want to use following symbols for buttons in my app: here my code: Button goToFirstButton = new Button("\uE318"); Button prevPageButton = new Button("\uE312"); Button nextPageButton = new Button("\uE313"); Button goToLastButton = new Button("\uE319"); and the result is It seems, that \uE318 and \uE313 are wrong. What should i ...

Best Open Source Asp.net (ajaxable) Forum

I'm looking for a good Forum to include in my application. I find Community Server toouseful but it is notopen source, any Sugesstion will appriciate. this forum should have an API to extend. and support Unicode ...

How do I create a Unicode directory on Windows using Perl?

I struggle to create directory names containing Unicode. I am on Windows XP and Perl Camelbox 5.10.0. Up until now I used to use File::Path qw ( make_path ) to create directories - which worked fine until the first cyrillic directory appeared. For files Win32API::File qw ( CreateFileW ) works fine if the file name is UTF-16LE encoded. ...

ICU Unicode Normal vs Fullwidth

I am somewhat new to unicode and unicode strings. I'm trying to determine the difference between "fullwidth" symbol and a normal one. Take these two for example: Normal: http://www.fileformat.info/info/unicode/char/20a9/index.htm Fullwidth: http://www.fileformat.info/info/unicode/char/ffe6/index.htm I notice that the fullwidth is def...

unicode class in Python

help(unicode) prints something like: class unicode(basestring) | unicode(string [, encoding[, errors]]) -> object ... but you can use something different from a basestring as argument, you can do unicode(1) and get u'1'. What happens in that call? int don't have a __unicode__ method to be called. ...

How to identify unicode keys on key press?

Hi, My application uses unicode characters and i have several text fields where i want to restrict user from inputing special characters like :'"; begin if not (Key in ['a'..'z','A'..'Z',' ','0'..'9',#13,#8]) then Key := #0; if Key = #13 then bOk.Click; end; So at this point it lets user add spaces and use a b...

How do I check if a Unicode directory exists on Windows in Perl?

I need to check whether a Unicode directory exists in Perl. I am using Windows XP and Perl Camelbox 5.10.0. If I try to create a directory (like Sinan suggested here stackoverflow.com/questions/2184726) that already exists the program dies. Unfortunately if ( !-d $dir_name ) { # create directory $dir_name } doesn't seem to recognize Un...

Python: convert RTF file to unicode?

I'm trying to convert lines in an RTF file to a series of unicode strings, and then do a regex match on the lines. (I need them to be unicode so that I can output them to another file.) However, my regex match isn't working - I think because they aren't being converted into unicode properly. Here's my code: usefulLines = [] textData =...

Django <-> SQL Server 2005, text encoding problem

Hello, I'm trying to store Django data on MS SQL Server 2005 using: http://code.google.com/p/django-pyodbc/ (pyodbc + FreeTDS) As long as I'm storing string consist of ASCII characters everything is ok. When I'm using unicode (ex. '\xc5\x82'), django throws ProgrammingError on: ProgrammingError at /admin/cli/punktrejestracji/add/ ('4...

Python conversion to ISO-8859-5

I'm facing problems when trying to convert a UTF-8 file (containing Russian characters) into an ISO-8859-5 file: 'charmap' codec can't encode character u'\ufeff' in position 0: character maps to . Has anyone got an idea of what's wrong(?) given the following: def convert(): try: import codecs data = codecs.open('in.t...

How Can I detect Unknown/Unassigned Unicode characters in my java program?

Hi, I want to write a java program to print Unicode characters. I want to detect and not print Unknown/Unassigned CHaracters (which are shown by a rectangular). I have tried "isDefined" and "isISOControl" from "Character" class, but it does not work. Does anybody know the solution? it will be a big help for me. Thanks. ...

Unicode setlocale and strftime fails at windows

I have one page and it's encoding is UTF-8 and If i try to run that code in unix system everythings looks fine but when i try to run in windows(7) some chracters looks question mark(�). How can run the code fine both of two system(without using iconv). header('Content-Type: text/html; charset=UTF-8'); setlocale(LC_ALL, 'turkish'); echo ...

Replace newlines in a Unicode string

I am trying to replace newline characters in a unicode string and seem to be missing some magic codes. My particular example is that I am working on AppEngine and trying to put titles from HTML pages into a db.StringProperty() in my model. So I do something like: link.title = unicode(page_title,"utf-8").replace('\n','').replace('\r','...