Newsgroup: it.comp.appl.access
Titolo: caratteri non accettati nel file xml - fatturazione elettronica

qualcuno può aiutarmi? devo convertire tutte le stringhe salvate in access per creare il file xml e Bruno mi ha segnalato che alcuni caratteri non sono accettati ho trovato questa tabella in google
 
&   &amp;
à   &agrave;
á   &aacute;
è   &egrave;
é   &eacute;
ì   &igrave;
í   &iacute;
ò   &ograve;
ó   &oacute;
ù   &ugrave;
ú   &uacute;
 
qualcuno può confermi che se utilizzo replace nel caso siano presenti nelle stringhe questi caratteri speciali sostituendoli con il codice alla destra
esempio la & con &amp il SDI (sistema di interscambio) accetta il file xml?
 
grazie a tutti.

Virgolette e apistrofo?
 
" E '
 
???


anche quelle? sai il carattere da sostituire?
è corretto quello che ho scritto nel mio post?

Ciao,
tutti i caratteri speciali xml vanno codificati pe. < > "
Qui le specifiche xml
https://www.w3.org/TR/xml/#syntax
 
 
Ciao
Mat


con questa si è abbastanza tranquilli
 
 
Public Function HTMLEntititesDecode(p_strText As String) As String
Dim strTemp As String
strTemp = p_strText
strTemp = Replace(strTemp, "&quot;", """")
strTemp = Replace(strTemp, "&amp;", "&")
strTemp = Replace(strTemp, "&apos;", "'")
strTemp = Replace(strTemp, "&lt;", "<")
strTemp = Replace(strTemp, "&gt;", ">")
strTemp = Replace(strTemp, "&nbsp;", "")
strTemp = Replace(strTemp, "&iexcl;", "¡")
strTemp = Replace(strTemp, "&cent;", "¢")
strTemp = Replace(strTemp, "&pound;", "£")
strTemp = Replace(strTemp, "&curren;", "¤")
strTemp = Replace(strTemp, "&yen;", "¥")
strTemp = Replace(strTemp, "&brvbar;", "¦")
strTemp = Replace(strTemp, "&sect;", "§")
strTemp = Replace(strTemp, "&uml;", "¨")
strTemp = Replace(strTemp, "&copy;", "©")
strTemp = Replace(strTemp, "&ordf;", "ª")
strTemp = Replace(strTemp, "&laquo;", "«")
strTemp = Replace(strTemp, "&not;", "¬")
strTemp = Replace(strTemp, "*", "")
strTemp = Replace(strTemp, "&reg;", "®")
strTemp = Replace(strTemp, "&macr;", "¯")
strTemp = Replace(strTemp, "&deg;", "°")
strTemp = Replace(strTemp, "&plusmn;", "±")
strTemp = Replace(strTemp, "&sup2;", "²")
strTemp = Replace(strTemp, "&sup3;", "³")
strTemp = Replace(strTemp, "&acute;", "´")
strTemp = Replace(strTemp, "&micro;", "µ")
strTemp = Replace(strTemp, "&para;", "¶")
strTemp = Replace(strTemp, "&middot;", "·")
strTemp = Replace(strTemp, "&cedil;", "¸")
strTemp = Replace(strTemp, "&sup1;", "¹")
strTemp = Replace(strTemp, "&ordm;", "º")
strTemp = Replace(strTemp, "&raquo;", "»")
strTemp = Replace(strTemp, "&frac14;", "¼")
strTemp = Replace(strTemp, "&frac12;", "½")
strTemp = Replace(strTemp, "&frac34;", "¾")
strTemp = Replace(strTemp, "&iquest;", "¿")
strTemp = Replace(strTemp, "&Agrave;", "À")
strTemp = Replace(strTemp, "&Aacute;", "Á")
strTemp = Replace(strTemp, "&Acirc;", "Â")
strTemp = Replace(strTemp, "&Atilde;", "Ã")
strTemp = Replace(strTemp, "&Auml;", "Ä")
strTemp = Replace(strTemp, "&Aring;", "Å")
strTemp = Replace(strTemp, "&AElig;", "Æ")
strTemp = Replace(strTemp, "&Ccedil;", "Ç")
strTemp = Replace(strTemp, "&Egrave;", "È")
strTemp = Replace(strTemp, "&Eacute;", "É")
strTemp = Replace(strTemp, "&Ecirc;", "Ê")
strTemp = Replace(strTemp, "&Euml;", "Ë")
strTemp = Replace(strTemp, "&Igrave;", "Ì")
strTemp = Replace(strTemp, "&Iacute;", "Í")
strTemp = Replace(strTemp, "&Icirc;", "Î")
strTemp = Replace(strTemp, "&Iuml;", "Ï")
strTemp = Replace(strTemp, "&ETH;", "Ð")
strTemp = Replace(strTemp, "&Ntilde;", "Ñ")
strTemp = Replace(strTemp, "&Ograve;", "Ò")
strTemp = Replace(strTemp, "&Oacute;", "Ó")
strTemp = Replace(strTemp, "&Ocirc;", "Ô")
strTemp = Replace(strTemp, "&Otilde;", "Õ")
strTemp = Replace(strTemp, "&Ouml;", "Ö")
strTemp = Replace(strTemp, "&times;", "×")
strTemp = Replace(strTemp, "&Oslash;", "Ø")
strTemp = Replace(strTemp, "&Ugrave;", "Ù")
strTemp = Replace(strTemp, "&Uacute;", "Ú")
strTemp = Replace(strTemp, "&Ucirc;", "Û")
strTemp = Replace(strTemp, "&Uuml;", "Ü")
strTemp = Replace(strTemp, "&Yacute;", "Ý")
strTemp = Replace(strTemp, "&THORN;", "Þ")
strTemp = Replace(strTemp, "&szlig;", "ß")
strTemp = Replace(strTemp, "&agrave;", "à")
strTemp = Replace(strTemp, "&aacute;", "á")
strTemp = Replace(strTemp, "&acirc;", "â")
strTemp = Replace(strTemp, "&atilde;", "ã")
strTemp = Replace(strTemp, "&auml;", "ä")
strTemp = Replace(strTemp, "&aring;", "å")
strTemp = Replace(strTemp, "&aelig;", "æ")
strTemp = Replace(strTemp, "&ccedil;", "ç")
strTemp = Replace(strTemp, "&egrave;", "è")
strTemp = Replace(strTemp, "&eacute;", "é")
strTemp = Replace(strTemp, "&ecirc;", "ê")
strTemp = Replace(strTemp, "&euml;", "ë")
strTemp = Replace(strTemp, "&igrave;", "ì")
strTemp = Replace(strTemp, "&iacute;", "í")
strTemp = Replace(strTemp, "&icirc;", "î")
strTemp = Replace(strTemp, "&iuml;", "ï")
strTemp = Replace(strTemp, "&eth;", "ð")
strTemp = Replace(strTemp, "&ntilde;", "ñ")
strTemp = Replace(strTemp, "&ograve;", "ò")
strTemp = Replace(strTemp, "&oacute;", "ó")
strTemp = Replace(strTemp, "&ocirc;", "ô")
strTemp = Replace(strTemp, "&otilde;", "õ")
strTemp = Replace(strTemp, "&ouml;", "ö")
strTemp = Replace(strTemp, "&divide;", "÷")
strTemp = Replace(strTemp, "&oslash;", "ø")
strTemp = Replace(strTemp, "&ugrave;", "ù")
strTemp = Replace(strTemp, "&uacute;", "ú")
strTemp = Replace(strTemp, "&ucirc;", "û")
strTemp = Replace(strTemp, "&uuml;", "ü")
strTemp = Replace(strTemp, "&yacute;", "ý")
strTemp = Replace(strTemp, "&thorn;", "þ")
strTemp = Replace(strTemp, "&yuml;", "ÿ")
strTemp = Replace(strTemp, "&OElig;", "Œ")
strTemp = Replace(strTemp, "&oelig;", "œ")
strTemp = Replace(strTemp, "&Scaron;", "Š")
strTemp = Replace(strTemp, "&scaron;", "š")
strTemp = Replace(strTemp, "&Yuml;", "Ÿ")
strTemp = Replace(strTemp, "&fnof;", "ƒ")
strTemp = Replace(strTemp, "&circ;", "ˆ")
strTemp = Replace(strTemp, "&tilde;", "˜")
strTemp = Replace(strTemp, "&thinsp;", "")
strTemp = Replace(strTemp, "&zwnj;", "")
strTemp = Replace(strTemp, "&zwj;", "")
strTemp = Replace(strTemp, "&lrm;", "")
strTemp = Replace(strTemp, "&rlm;", "")
strTemp = Replace(strTemp, "&ndash;", "–")
strTemp = Replace(strTemp, "&mdash;", "—")
strTemp = Replace(strTemp, "&lsquo;", "‘")
strTemp = Replace(strTemp, "&rsquo;", "’")
strTemp = Replace(strTemp, "&sbquo;", "‚")
strTemp = Replace(strTemp, "&ldquo;", "“")
strTemp = Replace(strTemp, "&rdquo;", "”")
strTemp = Replace(strTemp, "&bdquo;", "„")
strTemp = Replace(strTemp, "&dagger;", "†")
strTemp = Replace(strTemp, "&Dagger;", "‡")
strTemp = Replace(strTemp, "&bull;", "•")
strTemp = Replace(strTemp, "&hellip;", "…")
strTemp = Replace(strTemp, "&permil;", "‰")
strTemp = Replace(strTemp, "&lsaquo;", "‹")
strTemp = Replace(strTemp, "&rsaquo;", "›")
strTemp = Replace(strTemp, "&euro;", "€")
strTemp = Replace(strTemp, "&trade;", "™")
HTMLEntititesDecode = strTemp
End Function
 
 
---
Questa email è stata esaminata alla ricerca di virus da AVG.
http://www.avg.com
 
 


sorry devi invertire le due stringhe
con questa decodifichi
 
ciao

Il 03/10/2018 14:21, BFS ha scritto:

Private Function EncodeString(strOriginal as string) as string
     Dim strTemp as string
     strTemp = strOriginal
     strTemp = Replace(strTemp, "ó", "&oacute;")
     strTemp = Replace(strTemp, "á", "&aacute;")
     strTemp = Replace(strTemp, "é", "&eacute;")
     strTemp = Replace(strTemp, "í", "&iacute;")
     strTemp = Replace(strTemp, "ú", "&uacute;")
     strTemp = Replace(strTemp, "Á", "&Aacute;")
     strTemp = Replace(strTemp, "É", "&Eacute;")
     strTemp = Replace(strTemp, "Í", "&Iacute;")
     strTemp = Replace(strTemp, "Ó", "&Oacute;")
     strTemp = Replace(strTemp, "Ú", "&Uacute;")
     strTemp = Replace(strTemp, "¡", "&iexcl;")
     strTemp = Replace(strTemp, "¢", "&cent;")
     strTemp = Replace(strTemp, "£", "&pound;")
     strTemp = Replace(strTemp, "¤", "&curren;")
     strTemp = Replace(strTemp, "¥", "&yen;")
     strTemp = Replace(strTemp, "¦", "&brvbar;")
     strTemp = Replace(strTemp, "§", "&sect;")
     strTemp = Replace(strTemp, "¨", "&uml;")
     strTemp = Replace(strTemp, "©", "&copy;")
     strTemp = Replace(strTemp, "ª", "&ordf;")
     strTemp = Replace(strTemp, "«", "&laquo;")
     strTemp = Replace(strTemp, "¬", "&not;")
     strTemp = Replace(strTemp, "®", "&reg;")
     strTemp = Replace(strTemp, "¯", "&macr;")
     strTemp = Replace(strTemp, "°", "&deg;")
     strTemp = Replace(strTemp, "±", "&plusmn;")
     strTemp = Replace(strTemp, "²", "&sup2;")
     strTemp = Replace(strTemp, "³", "&sup3;")
     strTemp = Replace(strTemp, "´", "&acute;")
     strTemp = Replace(strTemp, "µ", "&micro;")
     strTemp = Replace(strTemp, "¶", "&para;")
     strTemp = Replace(strTemp, "·", "&middot;")
     strTemp = Replace(strTemp, "¸", "&cedil;")
     strTemp = Replace(strTemp, "¹", "&sup1;")
     strTemp = Replace(strTemp, "º", "&ordm;")
     strTemp = Replace(strTemp, "»", "&raquo;")
     strTemp = Replace(strTemp, "¼", "&frac14;")
     strTemp = Replace(strTemp, "½", "&frac12;")
     strTemp = Replace(strTemp, "¾", "&frac34;")
     strTemp = Replace(strTemp, "¿", "&iquest;")
     strTemp = Replace(strTemp, "×", "&times;")
     strTemp = Replace(strTemp, "÷", "&divide;")
     strTemp = Replace(strTemp, "À", "&Agrave;")
     strTemp = Replace(strTemp, "Â", "&Acirc;")
     strTemp = Replace(strTemp, "Ã", "&Atilde;")
     strTemp = Replace(strTemp, "Ä", "&Auml;")
     strTemp = Replace(strTemp, "Å", "&Aring;")
     strTemp = Replace(strTemp, "Æ", "&AElig;")
     strTemp = Replace(strTemp, "Ç", "&Ccedil;")
     strTemp = Replace(strTemp, "È", "&Egrave;")
     strTemp = Replace(strTemp, "Ê", "&Ecirc;")
     strTemp = Replace(strTemp, "Ë", "&Euml;")
     strTemp = Replace(strTemp, "Ì", "&Igrave;")
     strTemp = Replace(strTemp, "Î", "&Icirc;")
     strTemp = Replace(strTemp, "Ï", "&Iuml;")
     strTemp = Replace(strTemp, "Ð", "&ETH;")
     strTemp = Replace(strTemp, "Ñ", "&Ntilde;")
     strTemp = Replace(strTemp, "Ò", "&Ograve;")
     strTemp = Replace(strTemp, "Ô", "&Ocirc;")
     strTemp = Replace(strTemp, "Õ", "&Otilde;")
     strTemp = Replace(strTemp, "Ö", "&Ouml;")
     strTemp = Replace(strTemp, "Ø", "&Oslash;")
     strTemp = Replace(strTemp, "Ù", "&Ugrave;")
     strTemp = Replace(strTemp, "Û", "&Ucirc;")
     strTemp = Replace(strTemp, "Ü", "&Uuml;")
     strTemp = Replace(strTemp, "Ý", "&Yacute;")
     strTemp = Replace(strTemp, "Þ", "&THORN;")
     strTemp = Replace(strTemp, "ß", "&szlig;")
     strTemp = Replace(strTemp, "à", "&agrave;")
     strTemp = Replace(strTemp, "â", "&acirc;")
     strTemp = Replace(strTemp, "ã", "&atilde;")
     strTemp = Replace(strTemp, "ä", "&auml;")
     strTemp = Replace(strTemp, "å", "&aring;")
     strTemp = Replace(strTemp, "æ", "&aelig;")
     strTemp = Replace(strTemp, "ç", "&ccedil;")
     strTemp = Replace(strTemp, "è", "&egrave;")
     strTemp = Replace(strTemp, "ê", "&ecirc;")
     strTemp = Replace(strTemp, "ë", "&euml;")
     strTemp = Replace(strTemp, "ì", "&igrave;")
     strTemp = Replace(strTemp, "î", "&icirc;")
     strTemp = Replace(strTemp, "ï", "&iuml;")
     strTemp = Replace(strTemp, "ð", "&eth;")
     strTemp = Replace(strTemp, "ñ", "&ntilde;")
     strTemp = Replace(strTemp, "ò", "&ograve;")
     strTemp = Replace(strTemp, "ô", "&ocirc;")
     strTemp = Replace(strTemp, "õ", "&otilde;")
     strTemp = Replace(strTemp, "ö", "&ouml;")
     strTemp = Replace(strTemp, "ø", "&oslash;")
     strTemp = Replace(strTemp, "ù", "&ugrave;")
     strTemp = Replace(strTemp, "û", "&ucirc;")
     strTemp = Replace(strTemp, "ü", "&uuml;")
     strTemp = Replace(strTemp, "ý", "&yacute;")
     strTemp = Replace(strTemp, "þ", "&thorn;")
     strTemp = Replace(strTemp, "ÿ", "&yuml;")
     EncodeString = strTemp
End Function


Grazie BFS quindi tutto ciò che è stringa nella fattura elettronica lo do in pasto a questa routine e dovrei essere tranquillo dico bene?
grazie.


ciao scusa ma non ho capito nulla di quel sito che hai indicato, cosa si deve fare? la routine postata da BFS non è sufficiente?

Il giorno mercoledì 3 ottobre 2018 14:52:02 UTC+2, BFS ha scritto:

forse dalla tua manca la "e" commerciale --> &


si quelle le sistemo a monte
 
cmq è & --> &amp;
devi gestire anche i doppi apici ""-->&quot;
 
 
 
 
 
 

 > con questa si è abbastanza tranquilli
 
(cut)
 
Pure io utilizzo una soluzione simile, ma dato che è difficile mappare tutti i caratteri non UTF8, alla fine del codice scansiono nuovamente la stringa e sostituisco eventuali residui:
 
Asc(TmpCrt) < 32 Or Asc(TmpCrt) > 126
 
con un bello SPAZIO.
 
E con un pò di forza bruta non ho più avuto spezzamenti di maroni con spesometri e FT P.A.
 
Saluti


Naaaaaa, invece di elevarci ci abbassiamo?
Vi invito a trovare un modo altrettanto efficace, ma elegante
E appena lo trovate, pubblicatelo, peppiacere
 

Ciao Simone... Non so se sei il Simone...
prova a vedere se questo ha qualche relazione fruibile:
https://www.di-mgt.com.au/howto-convert-vba-unicode-to-utf8.html
 
...
Oppure con un oggetto ADODB.STREAM proprietà 
Charset = "utf-8"
 
Saluti
@Alex

 
https://www.di-mgt.com.au/howto-convert-vba-unicode-to-utf8.html
 
 
 
Risorsa interessante, bravo!
 
 
 


se c'è una volta il doppio apice " diventa --> &quot;
tu hai scritto 2 doppi apici


io ho provato a mettere doppio apice " o apostrofo in una stringa ma il file xml me lo creo corretto senza darmi errori


intendo due apostrofi di seguito
a me da errore
ho un cliente che vende articoli con diametri misurati in pollici e il 
simbolo '' blocca il file
 
ciao
BFS


Ciao,
w3c.org
 è il sito di "quelli" che definiscono le specifiche dei file Xml (e altri standard del web), il link punta alla sezione dove si parla anche di caratteri riservati.
 
Ciao
Mat.