Re: SQLite and Unicode

2009-04-07 Thread Keary Suska
On Apr 6, 2009, at 2:31 PM, Тимофей Даньшин wrote: When I insert non-latin strings into my SQLite3 database, they turn into some weird sets of characters (as I select those strings later in Terminal), and the fields, which contain those strings, become unusable by my application. I

Fwd: SQLite and Unicode

2009-04-07 Thread Тимофей Даньшин
On Apr 7, 2009, at 8:14 PM, Keary Suska wrote: Are you properly encoding your C strings with -cStringUsingEncoding:? Yes, I think so. At present, I am using the -UTF8String method, but I also tried the - cStringUsingEncoding: to no avail. Here is the line that binds the string to the

Re: SQLite and Unicode

2009-04-07 Thread Keary Suska
On Apr 7, 2009, at 10:39 AM, Тимофей Даньшин wrote: On Apr 7, 2009, at 8:14 PM, Keary Suska wrote: Are you properly encoding your C strings with -cStringUsingEncoding:? Yes, I think so. At present, I am using the -UTF8String method, but I also tried the - cStringUsingEncoding: to no avail.

Re: SQLite and Unicode

2009-04-07 Thread Michael Ash
2009/4/7 Keary Suska cocoa-...@esoteritech.com: On Apr 7, 2009, at 10:39 AM, Тимофей Даньшин wrote: On Apr 7, 2009, at 8:14 PM, Keary Suska wrote: Are you properly encoding your C strings with -cStringUsingEncoding:? Yes, I think so. At present, I am using the -UTF8String method, but I

Re: SQLite and Unicode

2009-04-07 Thread Тимофей Даньшин
How do you define string (i.e. how is its value set)? There can be an issue with UTF8 constant strings. Have you called - canBeConvertedToEncoding: to make sure string is utf-8 compatible? To be on the safe side, i make a local copy of the method's input string. And the

Re: SQLite and Unicode

2009-04-07 Thread Keary Suska
On Apr 7, 2009, at 12:54 PM, Тимофей Даньшин wrote: I am deeply and sincerely ashamed of myself. The point is that i get that input string by splitting the string in my textView ([[myTextView textStorage] string]) into sentences. During that procedure i check every char if it is a sentence

Re: SQLite and Unicode

2009-04-07 Thread Greg Guerin
Oops: prior (No subject) post is in SQLite and Unicode thread. -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins

Re: SQLite and Unicode

2009-04-07 Thread Тимофей Даньшин
I am deeply and sincerely ashamed of myself. The point is that i get that input string by splitting the string in my textView ([[myTextView textStorage] string]) into sentences. During that procedure i check every char if it is a sentence terminator (?! or linebreak). And i do that by using

Re: SQLite and Unicode

2009-04-07 Thread Greg Guerin
Тимофей Даньшин wrote: To be on the safe side, i make a local copy of the method's input string. Maybe the lifetime of the local copy is less than what SQLite needs. I see in your code that you're releasing the copy, but is SQLite asynchronous and still needing the buffer to exist at that

Re: SQLite and Unicode

2009-04-07 Thread Michael Ash
2009/4/7 Тимофей Даньшин ok5.ad...@gmail.com: I am deeply and sincerely ashamed of myself. The point is that i get that input string by splitting the string in my textView ([[myTextView textStorage] string]) into sentences. During that procedure i check every char if it is a sentence

Re: SQLite and Unicode

2009-04-07 Thread Kirk Kerekes
To break your text into sentences, I suggest swiping componentsSeparatedByCharacterRunFromSet: from: http://thotzy.com/THOTZY/ComponentsSeparatedByCharacterRunFromSet%3A.html -- and create a character set of your sentence-splitting characters to prime it with. If you need to preserve

Re: SQLite and Unicode

2009-04-07 Thread Rosyna
You could try using - (NSRange)rangeOfComposedCharacterSequenceAtIndex: (NSUInteger)index; and see if the range is 1. But right now, I'm watching the highly informative humorist Glenn Beck. Oh, 1 was to pass over surrogate pairs, so you don't pass over anything. But honestly, you should

Re: SQLite and Unicode

2009-04-07 Thread Greg Guerin
Rosyna wrote: Oh, 1 was to pass over surrogate pairs, so you don't pass over anything. rangeOfComposedCharacterSequenceAtIndex: is for more than surrogate pairs. It also applies to base characters that have combining accents following them. For example, the Latin letter 'e' followed

Re: SQLite and Unicode

2009-04-07 Thread Adam R. Maxwell
On Apr 7, 2009, at 11:54 AM, Тимофей Даньшин wrote: I will now have to find another unicode-safe way to split the string into sentences. Others have addressed your Unicode issues, but for splitting a string into sentences (or other units), I'd use CFStringTokenizer with

SQLite and Unicode

2009-04-06 Thread Тимофей Даньшин
Hello. When I insert non-latin strings into my SQLite3 database, they turn into some weird sets of characters (as I select those strings later in Terminal), and the fields, which contain those strings, become unusable by my application. I googled for it for quite a bit, but everywhere it