Conv

ページ名:Conv
  • Conv$

ConvertedString = Conv$ ( String AS String , SourceCharset AS String , DestinationCharset AS String ) AS String ConvertedString = Conv ( String AS String , SourceCharset AS String , DestinationCharset AS String ) AS String

文字列をある文字セットから別の文字セットに変換します。 文字セットは、 "ASCII"、 "ISO-8859-1"、または "UTF-8"のような文字列で表されます。

Gambasインタプリタは内部でUTF-8文字セットを使用しています。

システムによって使用される文字セットはSystem.Charset.によって返されます。 これはMandrake 10.2のISO-8859-15でしたが、今では私が知っているすべてのLinuxシステムはUTF-8ベースです。

グラフィカルユーザインタフェースによって使用される文字セットはDesktop.Charset.によって返されます。 常にUTF-8であるべきです。

SourceCharsetおよびDestinationCharsetパラメータにすべてのエンコード名の組み合わせを使用できるわけではなく、コード化文字セットには多数の別名を含めることができます。

 

Note that not all combinations of encoding names can be used for the SourceCharset and DestinationCharset parameters and that a coded character set can have a number of aliases.

The conversion uses the iconv() GNU library function and can convert, among many other encodings, encoded Turkish (ISO-8859-9), Korean (EUC-KR), Simplified Chinese (GB2312), Arabic (WINDOWS-1256), Cyrillic (KOI8-R),Japanese (ISO-2022-JP)... into human-readable UTF-8.

For a full list of supported international text conversions type iconv -l in a terminal.

Errors

Message

Description
Bad string conversion (32) The string to convert contains untranslatable characters.
Unsupported string conversion (31) The specified charsets are unknown, or cannot be converted.

Examples

Dim sStr As String
Dim iInd As Integer

sStr = Conv$("Gambas", "ASCII", "EBCDIC-US")

For iInd =
1 To Len(sStr)
Print
Hex$(Asc(Mid$(sStr, iInd, 1)), 2); " ";
Next
C7 81 94 82 81 A2

 

Print Conv$("\xE7\xC1\xCD\xC2\xC1\xD3\x20\xD0\xCF\xDE\xD4\xC9\x20\xCF\xDA\xCE\xC1\xDE\xC1\xC5\xD4\x20\xC2\xC5\xCA\xD3\xC9\xCB", "KOI8-R", "UTF-8")
Гамбас почти означает бейсик

See also

 

 

シェアボタン: このページをSNSに投稿するのに便利です。

コメント

返信元返信をやめる

※ 悪質なユーザーの書き込みは制限します。

最新を表示する

NG表示方式

NGID一覧