views:

412

answers:

4

I'm working with Delphi 2009 update 2. Borland WSDLIMP Version 2.3 - $Rev: 16699 $

Why does the identifier rápido shows as r_pido ?
Where did the character á go?
Is this WSDLIMP bug or MS XML bug ?

thanks for replies

File.XSD

<?xml version="1.0" encoding="UTF-8"?>
....
....
....
<xs:simpleType name="displayName">
<xs:restriction base="st">
<xs:enumeration value="rápido"/> //-----> attention !!!
<xs:enumeration value="lento"/>
....
....
....

command prompt -->

wsdlimp -Oe- -Ow+ -P -= "c:\myWsdlFile.wsdl"=myService.pas

myService.pas

.....
.....
unit myService.pas;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
......
.....
displayName = (
r_pido, //---> attention!!! á Where did it go?
lento);
A: 

Not exactly sure what you mean, but I suspect the á in rápido. Try using "a" as in rapido.

Gamecat
I can not make changes on this File.XSD
What led you to believe this could be a problem with MS XML? Is that what Delphi uses to process XML? Also, does the Delphi language itself understand the word "rápido"? Can that word be used as an identifier in Delphi?
John Saunders
There shouldn't be a problem with Delphi 2009 (because it is the first fully unicode version) but obviously the á is replaced by a _.
Gamecat
A: 

rápido is correct identifier for delphi 2009 (delphi 2009 full support unicode)

+1  A: 

I see you asked this question a few weeks ago in the Embarcadero forums.

I suspect the WSDLImp utility has not bee updated for Delphi 2009's Unicode support. Instead, it continues to generate the same Delphi source files that earlier versions would have generated, thus ensuring that any Delphi version could use the resulting source file. One clue that the utility hasn't received significant updates is that it still lists itself as a Borland product instead of CodeGear or Embarcadero. Just because it was recompiled and has a different version number (2.2 versus 2.3) doesn't mean it got the same overhaul as the compiler and IDE that would be necessary to have it generate Unicode source files.

One thing to check is that your file really is encoded as UTF-8. The literal á character gets encoded as two bytes in UTF-8, so it wouldn't necessarily appear as that character in an editor. Make sure the file has the bytes C3 A1 where that character should be. If it doesn't, then you might simply be seeing how WSDLImp treats invalid bytes in the input file.

Rob Kennedy
A: 

I suspect the WSDLImp utility has not bee updated for Delphi 2009's Unicode support

c:\Program files\codegear\rad studio\6.0\source\win32\soap\wsdlimporter\WSDLImp.dpr again compiled with delphi 2009.

One thing to check is that your file really is encoded as UTF-8

file.xsd open with notepad. Save as--> Encoding --> UTF8 --> Save

I have updated my answer in response to this "answer." If you need to refine your question, then please edit your *question*. The answers at the bottom of the page are for *answers* to your question. You are not giving answers to your question.
Rob Kennedy