更新1:
咁系BOOK NAME呢 English name thx^^
你是指迪士尼六大公主吗 Snow White—白雪公主 (雪姑七友) Cinderella —灰姑娘 (仙履奇缘) Ariel —艾莉奥 (小鱼仙) Belle —贝儿 (美女与野兽) Aurora —睡美人 (睡公主) Ja ine —茉莉公主 (阿拉丁) —后边的是公主的正名 (是各位公主的代表作) 2006-12-02 21:58:57 补充: 其他的公主:Mulan — 花木兰 (代父从军)Pocahontas —宝嘉康蒂 (风中奇缘)
参考: 自己知
六个迪士尼传统故事的公主: The 6 Disney Princesses: 1 Snow White (from Snow White and the Seven Dwrafs) 2 Cinderella (from Cinderella) 3 Belle (from Beauty and the Beast) 4 Ariel (from Little Mermaid) 5 Ja ine (from Aladdin) 6 Aurora (from Sleeping Beauty)
白雪公主:Snow White 灰姑娘:Cindenella 贝 儿:Belle 睡公主:Sleeping Beauty 艾莉奥:Ariel 茉 莉:Ja ine
Ariel (美人鱼) Mulan (花木兰) Cinderella (灰姑娘) Snoe White (白雪公主) Ja ine (茉莉公主) Aurora (睡公主) Belle (贝儿) Pocahontas (宝嘉康蒂 )
参考: Me
有Ariel
Muian
Cinderella
Snow White
Ja ine
Aurora
Belle
Pocahontas等等
参考: disneygo/princes ain_iframe
nuisance
英 [ˈnju:sns]
美 [ˈnu:sns]
n讨厌的东西(人,行为)麻烦事; 非法妨害,损害; 麻烦事
1 He spent three days making an absolute nuisance of himself
他3天时间就把自己变成了个地地道道的“讨人嫌”。
来自柯林斯例句
2 Back in the 1980s drug users were a public nuisance in Zurich
在20世纪80年代,吸毒者在苏黎世是被众人所唾弃的。
来自柯林斯例句
3 It's a blooming nuisance because it frightens my dog to death
它真让人讨厌,快把我的狗吓死了。
来自柯林斯例句
本文将为大家详细讲述的是VB 实现MUI程序方法 希望本文能给大家的日常开发工作带来一些启示
之前 我负责一个VB 编写的办公自动化系统 要求能在运行时 支持在不同语言间切换(英文 中文 日文 德文 法文和西班牙文);实质就是实现一个VB 的MUI程序
这个需要的困难在于VB 显示文本的标准控件(Label Textbox等)不支持Unicode;但字符串在其内部是按Unicode保存的 也就是说VB 本身是支持Unicode的
VB 中 标准控件显示字符串的过程如下:
) 标准控件先将Unicode字符串转换成ANSI字符串;
) 标准控件尝试将ANSI字符串转换成其Font Charset属性中指定的字符集格式的字符串;如果转换失败 则显示为问号()
具体可参照:Display Unicode Strings in Visual Basic
因此 实现MUI程序的思路有两种:
) 将标准控件替换为能支持Unicode的控件;
) 将资源文件中不同字符集的文本 转换为ANSI格式 提供给标准控件使用;
第 )种方式可用 Forms (fm dll);
第 )种方式 我在网上找到两篇文章 但各有不足:
a) Auto Detect Language and Display Unicode in VB TextBox and Label Controls;
ChilkatCharset 控件需购买 具对日文的一些标点符号(如全角句号)不支持
b) How To Convert from ANSI to Unicode & Unicode to ANSI for OLE
没有测试成功
下面 着重介绍我自己认为比较成功的实现 它使用了ADODB Stream(msado tlb);其实现思路如下:
) 将程序中用到的文本保存为Unicode格式的资源文件中;
之所以将资源文本保存为双字节的Unicode格式 而非Utf 或Utf 格式 可省去从其它格式向VB 支持的Unicode格式转换过程
) 将显示文本的标准控件的Font Charset 设置为程序要显示语言所对应的字符集 并设置一种支持这种字符集的字体到Font Name属性
If g_Str NumJapanese > Then
charset = Shift_JIS
Text Font Name = MS UI Gothic
Text Font charset =
ElseIf g_Str NumKorean > Then
charset = ks_c_
Text Font Name = GulimChe
Text Font charset =
ElseIf g_Str NumCentralEuro > Then
charset = windows
Text Font Name = Arial
Text Font charset =
ElseIf g_Str NumArabic > Then
charset = windows
Text Font Name = Traditional Arabic
Text Font charset =
ElseIf g_Str NumHebrew > Then
charset = windows
Text Font Name = David
Text Font charset =
ElseIf g_Str NumCyrillic > Then
charset = windows
Text Font Name = Arial
Text Font charset =
ElseIf g_Str NumGreek > Then
charset = windows
Text Font Name = Arial
Text Font charset =
ElseIf g_Str NumThai > Then
charset = windows
Text Font Name = Angsana New
Text Font charset =
ElseIf g_Str NumChinese > Then
charset = gb
Text Font Name = SimSun
Text Font charset =
An alternative is to use Big :
Text Font Name = MingLiu
charset = big
fontCh =
Else
charset = windows
Text Font charset =
Text Font Name = Arial End If )
根据要显示的语言 利用ADODB Stream将资源文件中Unicode格式保存的字符串转换成操作系统的区域语言(Locale)支持字符集的字符串;
调用API来获取操作系统默认的区域语言设置(LocaleID)
Private Declare Function GetSystemDefaultLCID Lib kernel () As Long
将Unicode字符串 转换为指定字符集的字节数组;
用于转换用资源文件中读取的文本;
Public Function ConvertStringToBytes(ByRef strText As String charset As String) As Byte()
Dim objStream As ADODB Stream
Dim data() As Byte
init stream
Set objStream = New ADODB Stream
objStream charset = charset
objStream Mode = adModeReadWrite
objStream Type = adTypeText
objStream Open
write bytes into stream
objStream WriteText strText
objStream Flush
rewind stream and read text
objStream Position =
objStream Type = adTypeBinary
objStream Read skip first bytes as this is the utf marker
data = objStream Read()
close up and return
objStream Close
ConvertStringToUtf Bytes = data
End Function
转换为指定字符集的字节数组 转换为ANSI(即LocaleID)对应的字符集的字符串; 用于将ConvertStringToBytes()返回的字节数组转换为GetCharset()字符集的字符串
Public Function ConvertBytesToString(ByRef data() As Byte charset As String) As String
Dim objStream As ADODB Stream
Dim strTmp As String
init stream
Set objStream = New ADODB Stream
objStream charset = charset
objStream Mode = adModeReadWrite
objStream Type = adTypeBinary
objStream Open
write bytes into stream
objStream Write data
objStream Flush
rewind stream and read text
objStream Position =
objStream Type = adTypeText
strTmp = objStream ReadText
close up and return
objStream Close
ConvertUtf BytesToString = strTmp
End Function
获取操作系统默认区域语言对应的字符集
Public Function GetCharset() As String
Dim localeId As Long
Dim charset As String
获取操作系统的LocaleId
localeId = GetSystemDefaultLCID()
Select Case localeId
Case
charset = windows
Case
charset = gb
Case
charset = Shift_JIS
Case Else
charset = windows
End Select
GetCharset = charset End Function
显示资源文本中的文本
Private Sub DisplayText(filename As String)
保存资源文本中的文本的变量
Dim textBytes As Variant
Dim f As New FileSystemObject
Dim fs As TextStream
将Unicode文本读取到变量中
Set fs = f OpenTextFile(filename ForReading False TristateTrue)
Do While Not fs AtEndOfStream
textBytes = fs ReadAll
Loop fs Close
Convert to a Unicode string:
Dim s As String
s = textBytes
Dim t As Long
CkString是免费的第三方组件 可自动判定一个字符串所对应的字符集
下载地址:
Dim g_Str As New CkString
g_Str Str = s
获取资源文本所代表的字符集名称 设置对应的字体和字符集到textbox上
Dim charset As String
If g_Str NumJapanese > Then 日文
charset = Shift_JIS
Text Font Name = MS UI Gothic
Text Font charset =
ElseIf g_Str NumKorean > Then 韩语
charset = ks_c_
Text Font Name = GulimChe
Text Font charset =
ElseIf g_Str NumCentralEuro > Then 中欧语言
charset = windows
Text Font Name = Arial
Text Font charset =
ElseIf g_Str NumArabic > Then 阿拉伯语
charset = windows
Text Font Name = Traditional Arabic
Text Font charset =
ElseIf g_Str NumGreek > Then 希腊语
charset = windows
Text Font Name = Arial
Text Font charset =
ElseIf g_Str NumThai > Then 泰语
charset = windows
Text Font Name = Angsana New
Text Font charset =
ElseIf g_Str NumChinese > Then 中文
charset = gb
Text Font Name = SimSun
Text Font charset =
繁体则使用Big :
Text Font Name = MingLiu
charset = big
Text Font charset =
Else 默认值
charset = windows
Text Font charset =
Text Font Name = Arial
End If
Dim bytes() As Byte
Dim g_OSCharset As String
获取操作系统默认语言对应的字符集
g_OSCharset = GetCharset()
先将Unicode资源文本转换成对应的字节数组;
bytes = ConvertStringToBytes(s charset)
将字节数组转换成ANSI(即默认字符集)对应的字符串
vbstr = ConvertBytesToString(bytes g_OSCharset)
设置字符串到VB 的标准控件中
lishixinzhi/Article/program/net/201311/13483
本文将为大家详细讲述的是VB6实现MUI程序方法,希望本文能给大家的日常开发工作带来一些启示。
之前,我负责一个VB6编写的办公自动化系统,要求能在运行时,支持在不同语言间切换(英文,中文,日文,德文,法文和西班牙文);实质就是实现一个VB6的MUI程序
这个需要的困难在于VB6显示文本的标准控件(Label,Textbox等)不支持Unicode;但字符串在其内部是按Unicode保存的,也就是说VB6本身是支持Unicode的
VB6中,标准控件显示字符串的过程如下:
1) 标准控件先将Unicode字符串转换成ANSI字符串;
2) 标准控件尝试将ANSI字符串转换成其FontCharset属性中指定的字符集格式的字符串;如果转换失败,则显示为问号()
具体可参照:Display Unicode Strings in Visual Basic 60
因此,实现MUI程序的思路有两种:
1) 将标准控件替换为能支持Unicode的控件;
2) 将资源文件中不同字符集的文本,转换为ANSI格式,提供给标准控件使用;
第1)种方式可用 Forms 20 (fm20dll);
第2)种方式,我在网上找到两篇文章,但各有不足:
a) Auto-Detect Language and Display Unicode in VB6 TextBox and Label Controls;
ChilkatCharset2控件需购买,具对日文的一些标点符号(如全角句号)不支持
b) How To Convert from ANSI to Unicode
Unicode to ANSI for OLE
没有测试成功
下面,着重介绍我自己认为比较成功的实现,它使用了ADODBStream(msado25tlb);其实现思路如下:
1) 将程序中用到的文本保存为Unicode格式的资源文件中;
之所以将资源文本保存为双字节的Unicode格式,而非Utf8或Utf7格式,可省去从其它格式向VB6支持的Unicode格式转换过程
2) 将显示文本的标准控件的FontCharset,设置为程序要显示语言所对应的字符集,并设置一种支持这种字符集的字体到FontName属性
If g_StrNumJapanese
0 Then
charset = "Shift_JIS"
Text1FontName = "MS UI Gothic"
Text1Fontcharset = 128
ElseIf g_StrNumKorean
0 Then
charset = "ks_c_5601-1987"
Text1FontName = "GulimChe"
Text1Fontcharset = 129
ElseIf g_StrNumCentralEuro
0 Then
charset = "windows-1250"
Text1FontName = "Arial"
Text1Fontcharset = 238
ElseIf g_StrNumArabic
0 Then
charset = "windows-1256"
Text1FontName = "Traditional Arabic"
Text1Fontcharset = 178
ElseIf g_StrNumHebrew
0 Then
charset = "windows-1255"
Text1FontName = "David"
Text1Fontcharset = 177
ElseIf g_StrNumCyrillic
0 Then
charset = "windows-1251"
Text1FontName = "Arial"
Text1Fontcharset = 204
ElseIf g_StrNumGreek
0 Then
charset = "windows-1253"
Text1FontName = "Arial"
Text1Fontcharset = 161
ElseIf g_StrNumThai
0 Then
charset = "windows-874"
Text1FontName = "Angsana New"
Text1Fontcharset = 222
ElseIf g_StrNumChinese
0 Then
charset = "gb2312"
Text1FontName = "SimSun"
Text1Fontcharset = 134
' An alternative is to use Big5:
' Text1FontName = "MingLiu"
'charset = "big5"
'fontCh = 136
Else
charset = "windows-1252"
Text1Fontcharset = 0
Text1FontName = "Arial" End If 3)
根据要显示的语言,利用ADODBStream将资源文件中Unicode格式保存的字符串转换成操作系统的区域语言(Locale)支持字符集的字符串;
' 调用API来获取操作系统默认的区域语言设置(LocaleID)
Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
' 将Unicode字符串,转换为指定字符集的字节数组;
' 用于转换用资源文件中读取的文本;
Public Function ConvertStringToBytes(ByRef strText As String, charset As String) As Byte()
Dim objStream As ADODBStream
Dim data() As Byte
' init stream
Set objStream = New ADODBStream
objStreamcharset = charset
objStreamMode = adModeReadWrite
objStreamType = adTypeText
objStreamOpen
' write bytes into stream
objStreamWriteText strText
objStreamFlush
' rewind stream and read text
objStreamPosition = 0
objStreamType = adTypeBinary '
objStreamRead 3 ' skip first 3 bytes as this is the utf-8 marker
data = objStreamRead()
' close up and return
objStreamClose
ConvertStringToUtf8Bytes = data
End Function '
转换为指定字符集的字节数组,转换为ANSI(即LocaleID)对应的字符集的字符串; ' 用于将ConvertStringToBytes()返回的字节数组转换为GetCharset()字符集的字符串
Public Function ConvertBytesToString(ByRef data() As Byte, charset As String) As String
Dim objStream As ADODBStream
Dim strTmp As String
' init stream
Set objStream = New ADODBStream
objStreamcharset = charset
objStreamMode = adModeReadWrite
objStreamType = adTypeBinary
objStreamOpen
' write bytes into stream
objStreamWrite data
objStreamFlush
' rewind stream and read text
objStreamPosition = 0
objStreamType = adTypeText
strTmp = objStreamReadText
' close up and return
objStreamClose
ConvertUtf8BytesToString = strTmp
End Function
'获取操作系统默认区域语言对应的字符集
Public Function GetCharset() As String
Dim localeId As Long
Dim charset As String
' 获取操作系统的LocaleId
localeId = GetSystemDefaultLCID()
Select Case localeId
Case 1033
charset = "windows-1252"
Case 2052
charset = "gb2312"
Case 1041
charset = "Shift_JIS"
Case Else
charset = "windows-1252"
End Select
GetCharset = charset End Function
'显示资源文本中的文本
Private Sub DisplayText(filename As String)
'保存资源文本中的文本的变量
Dim textBytes As Variant
Dim f As New FileSystemObject
Dim fs As TextStream
'将Unicode文本读取到变量中
Set fs = fOpenTextFile(filename, ForReading, False, TristateTrue)
Do While Not fsAtEndOfStream
textBytes = fsReadAll
Loop fsClose
' Convert to a Unicode string:
Dim s As String
s = textBytes
Dim t As Long
' CkString是免费的第三方组件,可自动判定一个字符串所对应的字符集
' 下载地址zip
Dim g_Str As New CkString
g_StrStr = s
'获取资源文本所代表的字符集名称,设置对应的字体和字符集到textbox上
Dim charset As String
If g_StrNumJapanese
0 Then '日文
charset = "Shift_JIS"
Text1FontName = "MS UI Gothic"
Text1Fontcharset = 128
ElseIf g_StrNumKorean
0 Then '韩语
charset = "ks_c_5601-1987"
Text1FontName = "GulimChe"
Text1Fontcharset = 129
ElseIf g_StrNumCentralEuro
0 Then '中欧语言
charset = "windows-1250"
Text1FontName = "Arial"
Text1Fontcharset = 238
ElseIf g_StrNumArabic
0 Then '阿拉伯语
charset = "windows-1256"
Text1FontName = "Traditional Arabic"
Text1Fontcharset = 178
ElseIf g_StrNumGreek
0 Then '希腊语
charset = "windows-1253"
Text1FontName = "Arial"
Text1Fontcharset = 161
ElseIf g_StrNumThai
0 Then '泰语
charset = "windows-874"
Text1FontName = "Angsana New"
Text1Fontcharset = 222
ElseIf g_StrNumChinese
0 Then '中文
charset = "gb2312"
Text1FontName = "SimSun"
Text1Fontcharset = 134
' 繁体则使用Big5:
' Text1FontName = "MingLiu"
'charset = "big5"
'Text1Fontcharset = 136
Else '默认值
charset = "windows-1252"
Text1Fontcharset = 0
Text1FontName = "Arial"
End If
Dim bytes() As Byte
Dim g_OSCharset As String
'获取操作系统默认语言对应的字符集
g_OSCharset = GetCharset()
'先将Unicode资源文本转换成对应的字节数组;
bytes = ConvertStringToBytes(s, charset)
'将字节数组转换成ANSI(即默认字符集)对应的字符串
vbstr2 = ConvertBytesToString(bytes, g_OSCharset)
' 设置字符串到VB6的标准控件中
MeText1Text = vbstr2 End Sub
欢迎分享,转载请注明来源:品搜搜测评网