Home > Software engineering >  Very urgent online etc.!!!!!! Chinese characters problems multibyte strings OLE string charB how to
Very urgent online etc.!!!!!! Chinese characters problems multibyte strings OLE string charB how to

Time:11-01

The contents of the S parameter is the following:
-
The Content - Disposition: the form - data; Name="file1"; Filename="F: \ 1. JPG"
The content-type: application/octet stream -

Warrior who taught very urgent such as online o...

The contents of the above is S,

Below is implementation methods: the content of S

 Private Function StringToMB (S) 
Dim I, B, N
N=Len (S)
For I=1 To N
B=B & amp; ChrB (Asc (Mid (S, I, 1))) 'prompt error in this step overflow
Next
StringToMB=B
End the Function


The problem is that in the content of S, the contents of the filename="" in Chinese will be an error,
Prompted to overflow the problem how to solve the
I am a rookie warrior

CodePudding user response:

Do you have any thought about StrConv? Convert a string to a byte array

StrConv function


Returns a specified type conversion Variant (String),

Syntax

StrConv (string, conversion, LCID)

StrConv function grammar have been named the following parameters:

Part of the description
String parameters, necessary to convert the string expression,
Conversion necessary parameters, Integer, its value and the type of conversion,
LocaleID LCID optional, if the system is different, it is LocaleID (system LocaleID for default values,)


Set the value

Conversion parameter setting value is:

Constant value description
VbUpperCase 1 text string to uppercase,
VbLowerCase 2 will string literal to lowercase,
VbProperCase 3 every word at the beginning of the letters in the string to uppercase,
VbWide * 4 * single-byte characters in a string into a double byte character,
VbNarrow * 8 * double-byte characters in a string into a single-byte characters,
VbKatakana * * 16 * * hiragana characters in the string into a katakana characters,

VbHiragana 32 * * * * katakana characters in the string into hiragana characters,
VbUnicode 64 according to the system default code page will into Unicode string,
VbFromUnicode 128 string from Unicode to system default code page,



* is applied to the far east country,

* * only applied to Japan,

Note these constants are designated by VBA, can use them to replace the real value in the process, most of them can be combined, such as vbUpperCase + vbWide, mutex constant can't combination, vbUnicode + vbFromUnicode, for example, when the country is not applicable to use constant vbWide, vbNarrow, vbKatakana, and vbHiragana, will result in a runtime error,

Here are some general valid delimiter: Null (CRH $(0)), horizontal TAB (CRH $(9)), line (CRH $(10)), vertical tabs (CRH $(11)), in page (CRH $(12)), enter $(13) (CRH), blank (SBCS) (CRH $(32)), in a DBCS, blank actual value varies according to the countries/regions,

Description

Byte array into a string in the ANSI format, you should use StrConv function, when you convert Unicode format of the array, use the assignment statement,

CodePudding user response:

The parameter C is what meaning, don't understand?

CodePudding user response:

Upstairs eldest brother can I add your QQ to send something that you help me to analyse the QQ326963413 please me

CodePudding user response:

The parameter C I didn't see the 2 floor of the eldest brother
1/f, the eldest brother can add a QQ
  • Related