I'm using cp 932 and trying to get the output as i scripted:
#echo off
chcp 932
cls
echo a i u e o-ka ki ku ke ko-sa shi su se so-ta chi tsu te to-ha hi fu he ho-ma mi mu me mo-ya yu yo-ra ri ru re ro-wa wo n
echo.
echo あいうえお きかくけこ さしすせそ たちつてと なにぬねの はひふへほ まみむめも やゆよ らりるれろ わをん
echo.
echo アイウエオ カキクケコ サシスセソ タチツテト ナニヌネノ ハヒフヘホ マミムメモ ヤユヨ ラリルレロ ワヲン
pause>nul
but i get the following output:
a i u e o-ka ki ku ke ko-sa shi su se so-ta chi tsu te to-ha hi fu he
ho-ma mi mu me mo-ya yu yo-ra ri ru re ro-wa wo n
縺ゅ>縺・∴縺翫縺阪°縺上¢縺薙縺輔@縺吶○縺昴縺溘■縺、縺ヲ縺ィ縲縺ェ縺ォ縺ャ縺ュ縺ョ縲縺ッ縺イ縺オ縺ク縺サ縲縺セ縺ソ繧繧√b縲繧・f繧医繧峨j繧九l繧阪繧上r繧・
繧「繧、繧ヲ繧ィ繧ェ縲繧ォ繧ュ繧ッ繧ア繧ウ縲繧オ繧キ繧ケ繧サ繧ス縲繧ソ繝√ヤ繝・ヨ縲繝翫ル繝後ロ繝弱繝上ヲ繝輔・繝帙繝槭Α繝繝。繝「縲繝、繝ヲ繝ィ縲繝ゥ繝ェ繝ォ繝ャ繝ュ縲繝ッ繝イ繝ウ
How to display the right characters?
There is no problem. As you can see, I'm on (Central European) Windows with Latin script:
You need to save the script using right encoding:
Moreover, Windows itself switch to right font (my default cmd font is set to Courier New with no CJK script):
You can convert text to Base64 and Decode it in Vbscript to show text.
Save whole code bellow as a .vbs and run it.(Don't run it via cscript or wscript).
Try my way :
Str="44GC44GE44GG44GI44GK44CA44GN44GL44GP44GR44GT44CA44GV44GX44GZ44Gb44Gd44CA44Gf44Gh44Gk44Gm44Go44CA44Gq44Gr44Gs44Gt44Gu44CA44Gv44Gy44G144G444G744CA44G+44G/44KA44KB44KC44CA44KE44KG44KI44CA44KJ44KK44KL44KM44KN44CA44KP44KS44KT"
St="44Ki44Kk44Km44Ko44Kq44CA44Kr44Kt44Kv44Kx44Kz44CA44K144K344K544K744K944CA44K/44OB44OE44OG44OI44CA44OK44OL44OM44ON44OO44CA44OP44OS44OV44OY44Ob44CA44Oe44Of44Og44Oh44Oi44CA44Ok44Om44Oo44CA44Op44Oq44Or44Os44Ot44CA44Ov44Oy44Oz"
'===========================================================================
Function Base64Decode(ByVal vCode)
Set oNode = CreateObject("Msxml2.DOMDocument.3.0").CreateElement("base64")
oNode.dataType = "bin.base64"
oNode.text = vCode
Base64Decode = Stream_BinaryToString(oNode.nodeTypedValue)
Set oNode = Nothing
End Function
Function Stream_BinaryToString(Binary)
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = 1
BinaryStream.Open
BinaryStream.Write Binary
BinaryStream.Position = 0
BinaryStream.Type = 2
BinaryStream.CharSet = "utf-8"
Stream_BinaryToString = BinaryStream.ReadText
Set BinaryStream = Nothing
End Function
WSH.Echo "a i u e o-ka ki ku ke ko-sa shi su se so-ta chi tsu te to-ha hi fu he ho-ma mi mu me mo-ya yu yo-ra ri ru re ro-wa wo n"&vblf&Vblf&Base64Decode(Str)&vblf&Vblf&Base64Decode(St)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have this problem that I don't know how to solve.
First I've imported the XML data to a SQL table named Sheet1 to column MENUXML. A sample from the XML is:
<DADOSNOTAALTA titulo="Externa E6020731-INT NEFROLOGIA (27-10-2006*1:07:17 PM)" mostra="1" liga="novaalta.aspx?x=DADOSNOTAALTA" versao="1" data="27-10-2006" hora="1:09:05 PM" autor="CH" publica="" episodio="6020731" especialidade="SCI" interna="0">
<DTALTA titulo="Data da Alta" valor="27-10-2006, 12:59" />
<DESTINOT titulo="" valor="Consulta externa" />
<DESTINOD titulo="Obs:" valor="HGSA 31/10/2006" />
<MTADM titulo="" valor="DISFUNÇÃO ENXERTO RENAL
CREATININA 1,4 -2,2 AGORA 1,7" />
<RESUMO titulo="" valor="BIOPSIA RENAL - SINAIS DE NTA, SEM SINAIS NA MICROSC. ÓPTICA DE REJEIÇÃO AGUDA
C4D POSITIVO PERI-TUBULAR" />
<DIAGNO titulo="" valor="Transplante com rim de dador cadáver COM DISFUNÇÃO TRANSITÓRIA.
Transplante pâncreas
" />
<TRATAM titulo="" valor="Tacrolimus 5 + 4 mg, 12/12 horas
Sirolimus 2mg dia
Prednisolona 20mg, manhã
Valganciclovir 450mg
Omeprazol 20 mg dia
Bactrim 1 compr./dia
Epo B 6000 / 2 vezes /semana SC.
Ácido acetilsalicílico 100mg dias alternados
Carbonato de cálcio 2 gr, /dia
" />
<PROG titulo="" valor="" />
<PROPI titulo="" valor="" />
<MONIT titulo="" valor="FUNÇÃO RENAL E PANCREATICA E NIVEIS FÁRMACOS" />
<ORIENT titulo="" valor="cONSULTA EXTERNA TR RIM-PANCREAS" />
</DADOSNOTAALTA>
Then I've created a new table named Dados with the following columns:
dados_nota, destino_tratamento, destino_doente,
metodo_admissao, resumo, diagnostico, tratamento,
prog, propi, monitorizacao, orientacao
These are all present in the XML.
Table from where i want to extract the XML
Table where i want to save the transformed data
Now the problem is that i don't know how to make SQL Server read the the XML direct from the column and transfer it to the columns in the new database.
Kind regards
Your question might be clear for you, but it is not clear at all...
... they [columns] are all present in the XML...
Well, one might guess, but this is up to you :-D
Try this:
DECLARE #xml XML=
N'<DADOSNOTAALTA titulo="Externa E6020731-INT NEFROLOGIA (27-10-2006*1:07:17 PM)" mostra="1" liga="novaalta.aspx?x=DADOSNOTAALTA" versao="1" data="27-10-2006" hora="1:09:05 PM" autor="CH" publica="" episodio="6020731" especialidade="SCI" interna="0">
<DTALTA titulo="Data da Alta" valor="27-10-2006, 12:59" />
<DESTINOT titulo="" valor="Consulta externa" />
<DESTINOD titulo="Obs:" valor="HGSA 31/10/2006" />
<MTADM titulo="" valor="DISFUNÇÃO ENXERTO RENAL
CREATININA 1,4 -2,2 AGORA 1,7" />
<RESUMO titulo="" valor="BIOPSIA RENAL - SINAIS DE NTA, SEM SINAIS NA MICROSC. ÓPTICA DE REJEIÇÃO AGUDA
C4D POSITIVO PERI-TUBULAR" />
<DIAGNO titulo="" valor="Transplante com rim de dador cadáver COM DISFUNÇÃO TRANSITÓRIA.
Transplante pâncreas
" />
<TRATAM titulo="" valor="Tacrolimus 5 + 4 mg, 12/12 horas
Sirolimus 2mg dia
Prednisolona 20mg, manhã
Valganciclovir 450mg
Omeprazol 20 mg dia
Bactrim 1 compr./dia
Epo B 6000 / 2 vezes /semana SC.
Ácido acetilsalicílico 100mg dias alternados
Carbonato de cálcio 2 gr, /dia
" />
<PROG titulo="" valor="" />
<PROPI titulo="" valor="" />
<MONIT titulo="" valor="FUNÇÃO RENAL E PANCREATICA E NIVEIS FÁRMACOS" />
<ORIENT titulo="" valor="cONSULTA EXTERNA TR RIM-PANCREAS" />
</DADOSNOTAALTA>';
SELECT #xml.value(N'/DADOSNOTAALTA[1]/#titulo',N'nvarchar(max)') AS dadosnota_titulo
,#xml.value(N'/DADOSNOTAALTA[1]/#mostra',N'int') AS dadosnota_mostra --some int value
--ommited more attributes
,#xml.value(N'/DADOSNOTAALTA[1]/DTALTA[1]/#titulo',N'nvarchar(max)') AS dtalta_titulo
,#xml.value(N'/DADOSNOTAALTA[1]/DTALTA[1]/#valor',N'nvarchar(max)') AS dtalta_valor --bad datetime format, should be ISO8601...
--The rest should work the same...
UPDATE: Read from a table
Try this:
SELECT t.OtherColumn --add needed columns of your table
,t.YourXmlColumn.value(N'/DADOSNOTAALTA[1]/#titulo',N'nvarchar(max)') AS dadosnota_titulo
,t.YourXmlColumn.value(N'/DADOSNOTAALTA[1]/#mostra',N'int') AS dadosnota_mostra --some int value
--ommited more attributes
,t.YourXmlColumn.value(N'/DADOSNOTAALTA[1]/DTALTA[1]/#titulo',N'nvarchar(max)') AS dtalta_titulo
,t.YourXmlColumn.value(N'/DADOSNOTAALTA[1]/DTALTA[1]/#valor',N'nvarchar(max)') AS dtalta_valor --bad datetime format, should be ISO8601...
--The rest should work the same...
FROM YourTable AS t;
I have a an Access form with a subform in datasheet mode with edit mode allowed. All tables are stored inside an SQL Server (2008R2) and I just added a new column (bit not null default 0)
The subform datasource span on 3 tables and is working just fine as it is. However, as soon as I add a new column, everytime I try to change data, I get this error :
If I remove the column I just added, everything seems to work again.
Here is the datasource before
SELECT tblCommandeListe.Section, tblCommandeListe.Description, tblCommandeListe.[No item], tblCommandeListe.N°Commande, tblCommandeListe.Code, tblCommandeListe.Qte, tblCommandeListe.Dim, tblFournisseur.[Fournisseur-Nom], tblCommandeListe.Prix, tblCommandeListe.[Date de livraison], tblCommandeListe.[Cost Center], tblCommandeListe.Devise, tblCommandeListe.Complet, tblCommandeListe.[LB/Lin], tblCommandeListe.[Prix/lb], tblCommandeListe.Unite, tblCommandeListe.[Note 2], tblCo mmandeListe.Ordre, tblProduits.[Produit-DescriptionFRA], tblProduits.[Produit-Prix], tblProduits.[Produit-Unite], tblProduits.[Produit-Fournisseur], tblProduits.[Produit-LB/Lin], tblProduits.[Produit-Prix/lb], tblProduits.[Produit-Long nom], tblProduits.[Produit-Devise], tblCommandeListe.Condition, tblCommandeListe.[Date création], tblCommandeListe.[Enlever liste à commander], tblCommandeListe.[Unite ing], tblProduits.[Produit-Unite_ing], tblCommandeListe.[Dim ing], tblCommandeListe.DescTmp, tblCommandeListe.[User mod], tblCommandeListe.[Qte req], tblCommandeListe.Annuler, IIf(IsNull([Qte req]),0,[Qte req])*IIf(IsNull([Prix]),0,[Prix])*IIf(IsNull([Dim]),1,[Dim])*IIf(IsNull([LB/Lin]) Or [LB/Lin]=0,1,[LB/Lin]) AS Total, tblCommandeListe.[Relaché pour achat], tblProduits.[Produit-Priorité], tblFournisseur.[Fournisseur-Nom]
FROM (tblCommandeListe
LEFT JOIN tblProduits ON tblCommandeListe.Code = tblProduits.[Produit- Code])
LEFT JOIN tblFournisseur ON tblProduits.[Produit-Fournisseur] = tblFournisseur.Fournisseur_id
ORDER BY tblCommandeListe.Section, tblCommandeListe.Description;
and after I add the column
SELECT tblCommandeListe.Section, tblCommandeListe.Description, tblCommandeListe.[No item], tblCommandeListe.N°Commande, tblCommandeListe.Code, tblCommandeListe.Qte, tblCommandeListe.Dim, tblFournisseur.[Fournisseur-Nom], tblCommandeListe.Prix, tblCommandeListe.[Date de livraison], tblCommandeListe.[Cost Center], tblCommandeListe.Devise, tblCommandeListe.Complet, tblCommandeListe.[LB/Lin], tblCommandeListe.[Prix/lb], tblCommandeListe.Unite, tblCommandeListe.[Note 2], tblCommandeListe.Ordre, tblProduits.[Produit-DescriptionFRA], tblProduits.[Produit-Prix], tblProduits.[Produit-Unite], tblProduits.[Produit-Fournisseur], tblProduits.[Produit-LB/Lin], tblProduits.[Produit-Prix/lb], tblProduits.[Produit-Long nom], tblProduits.[Produit-Devise], tblCommandeListe.Condition, tblCommandeListe.[Date création], tblCommandeListe.[Enlever liste à commander], tblCommandeListe.[Unite ing], tblProduits.[Produit-Unite_ing], tblCommandeListe.[Dim ing], tblCommandeListe.DescTmp, tblCommandeListe.[User mod], tblCommandeListe.[Qte req], tblCommandeListe.Annuler, IIf(IsNull([Qte req]),0,[Qte req])*IIf(IsNull([Prix]),0,[Prix])*IIf(IsNull([Dim]),1,[Dim])*IIf(IsNull([LB/Lin]) Or [LB/Lin]=0,1,[LB/Lin]) AS Total, tblCommandeListe.[Relaché pour achat], tblProduits.[Produit-Priorité], tblFournisseur.[Fournisseur-Nom], tblCommandeListe.EstProduction
FROM (tblCommandeListe
LEFT JOIN tblProduits ON tblCommandeListe.Code = tblProduits.[Produit- Code])
LEFT JOIN tblFournisseur ON tblProduits.[Produit-Fournisseur] = tblFournisseur.Fournisseur_id
ORDER BY tblCommandeListe.Section, tblCommandeListe.Description;
The only difference I see is the new column at the end. I tried with other columns and so far, it still works after, so the problem might be the column itself, but how can that be ?
EDIT : I just did a test and it seems I get the exact same message when I tried to edit it directly in the table in Access!
I read a date from a SQL Server database through Entity Framework. I return the result to the web page and it's displayed like this :
Date(-658436400000)
I presume it's something about date format but all my attempt to resolve it lead to an exception.
Here the Entity Framework code in VB:
Public Function getEvenements(noFacture As String, bd As eFacturationEntities) As Array
Dim evenements As Array = (
From e In bd.ItemFactures Where e.NoFacture_cs = noFacture
Select e Select New With {
.noEvenement = e.NoEvenement_cn,
.depart = e.DetailFactures.FirstOrDefault.LieuPRCH,
.arrivee = e.DetailFactures.FirstOrDefault.LieuDest,
.nomBeneficiaire = e.Beneficiaire,
.NAM = e.DetailFactures.FirstOrDefault.NAM,
.dateDeNaissance = FormatDateTime(e.DetailFactures.FirstOrDefault.DateNaissance_dt),
.dateDeTransport = e.DetailFactures.FirstOrDefault.PRCH_dt,
.noAs811 = e.DetailFactures.FirstOrDefault.NoAS811}).ToArray()
Return evenements
End Function
Solution : call .toString on the date before sending it to the client.
.dateDeTransport = e.DetailFactures.FirstOrDefault.PRCH_dt.ToString,
But this solution may cause an Exceptionon on some case :
"LINQ to Entities ne reconnaît pas la méthode 'System.String
ToString()', et cette dernière ne peut pas être traduite en expression
de magasin."} System.Exception
(the french tradcution of VS is unclear ...)
I have a sql database with data about headers of news. Example:
id title
867 MPE consegue inverter julgamento
868 Defensoria P blica realiza licita
869 Prefeitos eleitos de todas as partes do Estado
870 Inc ndio deixa 80 pessoas desabrigadas
871 Carlos Amastha visita parlamentares
872 Defensoria P blica requer anula o
873 Marcelo Miranda diz que n o possui obriga o
874 Ex-assessor diz que Coimbra lhe deu dois cheques
I need to get each title and see if there are other news to talk about the same subject.
How i do it? My plataform is .Net and use sql server 2012.
You will probably want to put a Full-Text Index on this column and/or table. It's a complex subject, but you can start reading up on it here: http://msdn.microsoft.com/en-us/library/ms142571.aspx