Browse Source

Updated the error message when invalid UTF-8 strings are used in love.graphics.print and friends to mention UTF-8.

Alex Szpakowski 11 years ago
parent
commit
1108dea696

+ 1 - 1
src/modules/font/GlyphData.cpp

@@ -106,7 +106,7 @@ std::string GlyphData::getGlyphString() const
 	}
 	}
 	catch (utf8::exception &e)
 	catch (utf8::exception &e)
 	{
 	{
-		throw love::Exception("Decoding error: %s", e.what());
+		throw love::Exception("UTF-8 decoding error: %s", e.what());
 	}
 	}
 
 
 	// Just in case...
 	// Just in case...

+ 2 - 2
src/modules/font/Rasterizer.cpp

@@ -63,7 +63,7 @@ GlyphData *Rasterizer::getGlyphData(const std::string &text) const
 	}
 	}
 	catch (utf8::exception &e)
 	catch (utf8::exception &e)
 	{
 	{
-		throw love::Exception("Decoding error: %s", e.what());
+		throw love::Exception("UTF-8 decoding error: %s", e.what());
 	}
 	}
 
 
 	return getGlyphData(codepoint);
 	return getGlyphData(codepoint);
@@ -89,7 +89,7 @@ bool Rasterizer::hasGlyphs(const std::string &text) const
 	}
 	}
 	catch (utf8::exception &e)
 	catch (utf8::exception &e)
 	{
 	{
-		throw love::Exception("Decoding error: %s", e.what());
+		throw love::Exception("UTF-8 decoding error: %s", e.what());
 	}
 	}
 
 
 	return true;
 	return true;

+ 2 - 2
src/modules/font/freetype/Font.cpp

@@ -66,7 +66,7 @@ Rasterizer *Font::newRasterizer(love::image::ImageData *data, const std::string
 	catch (utf8::exception &e)
 	catch (utf8::exception &e)
 	{
 	{
 		delete [] glyphs;
 		delete [] glyphs;
-		throw love::Exception("Decoding error: %s", e.what());
+		throw love::Exception("UTF-8 decoding error: %s", e.what());
 	}
 	}
 
 
 	Rasterizer *r = newRasterizer(data, glyphs, numglyphs);
 	Rasterizer *r = newRasterizer(data, glyphs, numglyphs);
@@ -90,7 +90,7 @@ GlyphData *Font::newGlyphData(Rasterizer *r, const std::string &text)
 	}
 	}
 	catch (utf8::exception &e)
 	catch (utf8::exception &e)
 	{
 	{
-		throw love::Exception("Decoding error: %s", e.what());
+		throw love::Exception("UTF-8 decoding error: %s", e.what());
 	}
 	}
 
 
 	return r->getGlyphData(codepoint);
 	return r->getGlyphData(codepoint);

+ 2 - 2
src/modules/graphics/opengl/Font.cpp

@@ -367,7 +367,7 @@ void Font::print(const std::string &text, float x, float y, float extra_spacing,
 	}
 	}
 	catch (utf8::exception &e)
 	catch (utf8::exception &e)
 	{
 	{
-		throw love::Exception("Decoding error: %s", e.what());
+		throw love::Exception("UTF-8 decoding error: %s", e.what());
 	}
 	}
 
 
 	if (vertexcount <= 0 || glyphinfolist.size() == 0)
 	if (vertexcount <= 0 || glyphinfolist.size() == 0)
@@ -429,7 +429,7 @@ int Font::getWidth(const std::string &str)
 		}
 		}
 		catch(utf8::exception &e)
 		catch(utf8::exception &e)
 		{
 		{
-			throw love::Exception("Decoding error: %s", e.what());
+			throw love::Exception("UTF-8 decoding error: %s", e.what());
 		}
 		}
 
 
 		if (width > max_width)
 		if (width > max_width)