StringByteLength - spectrum_spatial - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrum™ software
Product
Spectrum™ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2026-02-13
ft:lastPublication
2026-02-13T17:17:07.540000
L1_Product_Gateway
Locate
L2_Product_Segment
Location Intelligence
L3_Product_Brand
Precisely Spectrum Spatial
L4_Investment_Segment
LI Enterprise
L5_Product_Group
Enterprise LI
L6_Product_Name
Spectrum Spatial

Description

Returns the number of bytes in a string for a given charset. It is sometimes useful to know the number of bytes needed to represent a string with multi-byte character sets (for example: UTF-8 or WindowsJapanese). A string with UTF-8 charset can use up to 4 bytes to represent a character.

Syntax

StringByteLength ( str,charset )

Arguments

str is a string expression

charset is a string representing the charset (MapBasic or Java)

Both arguments are required.

Example

Returns 32 because the eight Japanese characters use four bytes each when using UTF-32.
select StringByteLength("滋賀県草津市草津", "UTF-32") 

Remarks

If a non-string value is passed for str or charset, an error is thrown.

If an invalid charset (including an empty string) is passed for charset, an error is thrown.