That will depend on your compiler. Google would probably help you faster
than me.
CLucene can be compiled in non-Unicode mode by setting a #define (there is a
cmake flag for it iirc), but that is not your case (I can tell by the way
your compiler interprets the _t functions).
Itamar.
_____
From: Michel Nadeau [mailto:aka...@gmail.com]
Sent: Tuesday, October 20, 2009 4:44 PM
To: clucene-developers@lists.sourceforge.net
Subject: Re: [CLucene-dev] STRCPY_AtoT - First letter only?
Thanks! It works perfectly!
Side question: how can I compile my app in unicode mode? (I use CMake)
- Mike
aka...@gmail.com
On Tue, Oct 20, 2009 at 10:03 AM, Itamar Syn-Hershko
<ita...@divrei-tora.com> wrote:
It seems like you're compiling in ASCII mode (non-Unicode). If this
intentional, and you need to have your app that way for some reason, try
this:
_tprintf(_T("Field: %S, Value: %S\n"), tField, tValue);
_____
From: Michel Nadeau [mailto:aka...@gmail.com]
Sent: Tuesday, October 20, 2009 3:51 PM
To: clucene-developers@lists.sourceforge.net
Subject: [CLucene-dev] STRCPY_AtoT - First letter only?
Hi !
This problem isn't really related to CLucene... but I really can't find any
solution.
I ported my CLucene 0.9.23 code to CLucene 2.3.2 (so also from normal
Makefile to CMake).
See this test code in my CLucene project:
// Static
const long LEN_SHORT = 256;
const long LEN_HUGE = 200000;
// TCHAR
TCHAR tField[LEN_SHORT];
TCHAR tValue[LEN_HUGE];
// char strings
char sFieldName[LEN_SHORT] = {0};
char sFieldValue[LEN_HUGE] = {0};
// Test
strcpy(sFieldName, "field");
strcpy(sFieldValue, "value");
STRCPY_AtoT(tField, sFieldName, sizeof(sFieldName));
STRCPY_AtoT(tValue, sFieldValue, sizeof(sFieldValue));
_tprintf(_T("Field: %s, Value: %s\n"), tField, tValue);
In my CLucene 0.9.23 project, this code would output (as it should) :
Field: field, Value: value
But in my CLucene 2.3.2 project, the same code outputs:
Field: f, Value: v
I ALWAYS get ONLY the first letter when I _tprintf something - no idea why!
I use the same conversion method to insert fields/values in CLucene and so
far I'm still not 100% sure if it's only an output problem (_tprintf) or if
the TCHAR really contain only the first letter after the conversion
(STRCPY_AtoT).
Any idea?? Thanks!!
- Mike
aka...@gmail.com
----------------------------------------------------------------------------
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers