Hi!<неи<неиIf I'm using this code ExportToUrl function doesn't
work.<неи<неи> xStore->storeToURL(
OUString::OUString(uval,nLenOfWideCharStr),<неи> storeProps );<неи<неиHave
you some ideas?<неи<неиRegards!<неи<неи-----Original Message-----<неиFrom:
Andrea Pescetti [mailto:pesce...@apache.org] <неиSent: Thursday, May 01,
2014 7:22 PM<неиTo: api@openoffice.apache.org<неиCc:
kmi...@mail.ru<неиSubject: Re: problem with chinese
language<неи<неиForwarding Herbert's answer in case the original poster did
not get it. <неиAndrea<неи<неиOn 29/04/2014 Herbert Duerr wrote:<неи> On
29.04.2014 14:15, K. Misha wrote:<неи>> Our company has developed
LibOpenOffice<неи>> <http://4k.com.ua/products/others/libopenoffice?lang=en>
library for<неи>> OpenOffice automation. Our clients from China said that
this code doesn't<неи>> work with chinese file path:<неи>><неи>> bool
exportToUrl(char *url) {<неи>><неи>>        try {<неи>><неи>>
int nLenOfWideCharStr =<неи>>
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,url,-1,NULL,0);<неи>><неи>>
wchar_t *uval = (PWSTR)HeapAlloc(GetProcessHeap(), 0,<неи>>
nLenOfWideCharStr * sizeof(WCHAR));<неи>><неи>><неи>>
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,url,-1,uval,nLenOfWideCharStr);<не
и>><неи>><неи>><неи>>              Reference<XStorable> xStore
(xCalcComponent, UNO_QUERY);<неи>><неи>>
Sequence<PropertyValue> storeProps(1);<неи>><неи>>
storeProps[0].Name = OUString::createFromAscii(<неи>> "FilterName"
);<неи>><неи>>              storeProps[0].Value <<=
OUString::createFromAscii( "MS<неи>> Excel 97"<неи>> );<неи>><неи>>
xStore->storeToURL( OUString::OUString(uval), storeProps );<неи><неи> Use a
line such as<неи><неи> xStore->storeToURL(
OUString::OUString(uval,nLenOfWideCharStr),<неи> storeProps );<неи><неи>
instead. This sets the string length explicitly instead of relying on<неи>
finding a trailing zero.<неи><неи> Hope that helps.<неи><неи>
Herbert<неи><неи>
---------------------------------------------------------------------<неи>
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org<неи> For
additional commands, e-mail: api-h...@openoffice.apache.org<неи><неи><неи


---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org

Reply via email to