Home > Software engineering >  Vb6 processing foreign characters display garbled question!!!!!!
Vb6 processing foreign characters display garbled question!!!!!!

Time:10-19

There are a lot of data in a database table, one of the string is "Stra? E ", including a German letters? , I use the SQL data acquisition to the rs, with TMP=rs. Get string (,,, "",, vbCrLf) to get a long string, use the
Open "C: \ test CSV" For the Output As the # 1
Print # 1, TMP
Written to a CSV file, other data is normal, but the German letters according to the code?
Should I how to solve this problem, please?
(I trace, the rs data is normal, but to the TMP is garbled, also show the code in written to the CSV)

CodePudding user response:

When you look at the CSV file, with a corresponding word stock, don't in TMP, unless your system environment is in German word stock,

System is transmitted between code, only to see, just take out the pictures from the character displayed on the screen or printed to paper,

CodePudding user response:

When you look at the garbled characters of DF coding?

The Debug. Print Hex (Asc (Mid (TMP, 5, 1)))

Seems should use the text character set Latin1_General_BIN (ISO - 8859) :
 
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 x
1 x
2 x SP! "# $% & amp; '() *, +, -,/
3 x 0 1 2 3 4 5 6 7 8 9:; <=& gt; ?
4 x @ A B C D E F G H I J K L M N O
5 X P Q R S T U V W X Y Z [\] ^ _
6 x ` a b c d e f g h I j k l m n o
7 x p q r s t u v w x y z {|} ~
8 x
9 x
Ax NBSP? ¢on problem RMB | § ¨? A? ? SHY? ˉ
Bx ° plus or minus 2, 3, 'mu? Who? 1 o? ? ? ? ?
Cx aa? ? ? ? ? ? E e e? I I? ?
Dx D? O o? ? ? X? U u? U T Y?
The Ex a aa? ? ? ? ? E e e? I I? ?
Fx e? O o? ? ? Present? U u? U t y?

Your problem is the opposite of this post:
database field is the code in Chinese, how to turn?

CodePudding user response:

refer to the second floor of123 response:
you see garbled characters of DF coding?

The Debug. Print Hex (Asc (Mid (TMP, 5, 1)))

Seems should use the text character set Latin1_General_BIN (ISO - 8859) :
 
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 x
1 x
2 x SP! "# $% & amp; '() *, +, -,/
3 x 0 1 2 3 4 5 6 7 8 9:; <=& gt; ?
4 x @ A B C D E F G H I J K L M N O
5 X P Q R S T U V W X Y Z [\] ^ _
6 x ` a b c d e f g h I j k l m n o
7 x p q r s t u v w x y z {|} ~
8 x
9 x
Ax NBSP? ¢on problem RMB | § ¨? A? ? SHY? ˉ
Bx ° plus or minus 2, 3, 'mu? Who? 1 o? ? ? ? ?
Cx aa? ? ? ? ? ? E e e? I I? ?
Dx D? O o? ? ? X? U u? U T Y?
The Ex a aa? ? ? ? ? E e e? I I? ?
Fx e? O o? ? ? Present? U u? U t y?

Your problem is the opposite of this post:
database field is the code in Chinese, how to turn?
garbled code is 3 f ~ ~

CodePudding user response:

You are coding for unicode character U + 00 df, of course, can not use ANSI code statements such as OPEN to deal with, really want to use in a Binary way way to OPEN the file directly to an array of bytes written

CodePudding user response:

CodePudding user response:

The code coding is 3 f ~ ~
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

This is because you use String under the Chinese system, the system will be all under the character cannot resolve the characters to use? Instead,

You try using a Byte array to save your string,

CodePudding user response:

You don't try to open under the Chinese system of C: \ test CSV in view to the correct character display, because you choose to open its software no coding, system in Chinese word stock is to explain the ASCII & gt; 127 characters,

In other words, even if you write to, open the file can't see,

Try to web page file, choose the code in the browser to see,

CodePudding user response:

For computer no noise, only the binary bytes; To the human brain is gibberish, GBK: 0 xb0 0 xa1, Unicode - 16 LE: 0 x4a 0 x55, Unicode - 16 BE: 0 x55 0 x4a, utf-8 8-0 x95 xE5 0 0 x8a
  • Related