[yunqa.de] Re: Smart quotes and other Unicode characters

  • From: Rick Tharp <ricktharp@xxxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Wed, 17 Apr 2013 07:24:01 -0500

Using D-2007 with the JEDI TJvRichEdit control for the editor. I'll look
into your TNT components. Thanks for your sage advice Ralf.


On Wed, Apr 17, 2013 at 4:51 AM, Delphi Inspiration <delphi@xxxxxxxx> wrote:

> On 16.04.2013 23:32, Rick Tharp wrote:
>
> > I use your DISQLite3 component in a desktop wiki program.
>
> While DISQLite3 is an excellent choice for a desktop wiki database, your
> problem seems unrelated to DISQLite3. Still some thoughts further down.
>
> > Sometimes the users will paste text (usually from Word) which
> > contains "smart" quotes and dashes, these then end up being saved as
> > long strings of nonsense characters such as ムリリズム- etc.
>
> Are you using a Unicode edit? The characters your are quoting usually
> result from Unicode -> UTF-8 conversions.
>
> They might be applied automatically if your application uses ANSI
> controls. If so, try to change to Unicode controls like those from the
> later Delphi versions.
>
> For Delphi 2007 or earlier, you may use the TNT Unicode components which
> you can download from my web page.
>
> > In your experience, what is the best way to deal with this
> > situation? Add some code to strip away these characters or (somehow)
> > convert them to ASCII? Or change the encoding of the SQLite database
> > to something other than UTF-8? Or something else?
>
> For SQLite, the database encoding does not matter - all SQLite encodings
> store all Unicode characters. However, please note that some SQLite
> interfaces come in two flavours: UTF-8 and UTF-16. Make sure you pick the
> correct one for the type of text you are passing / retrieving or convert
> accordingly.
>
> If the above do not sort out the character mess, you will indeed need to
> clean up algorithmically.
>
> Ralf
> _______________________________________________
> Delphi Inspiration mailing list
> yunqa@xxxxxxxxxxxxx
> //www.freelists.org/list/yunqa
>
>
>
>

Other related posts: